diff --git a/ansible/group_vars/all/ipa b/ansible/group_vars/all/ipa index 62347a573..647923be0 100644 --- a/ansible/group_vars/all/ipa +++ b/ansible/group_vars/all/ipa @@ -49,6 +49,9 @@ ipa_build_dib_env: > # stackhpc.os-images role for usage. ipa_build_dib_git_elements: [] +# List of DIB packages to install. Default is none. +ipa_build_dib_packages: [] + ############################################################################### # Ironic Python Agent (IPA) images configuration. diff --git a/ansible/overcloud-ipa-build.yml b/ansible/overcloud-ipa-build.yml index 3b7a51399..aa3c19946 100644 --- a/ansible/overcloud-ipa-build.yml +++ b/ansible/overcloud-ipa-build.yml @@ -36,6 +36,7 @@ - name: "{{ ipa_image_name }}" elements: "{{ ipa_build_dib_elements }}" env: "{{ ipa_build_dib_env }}" + packages: "{{ ipa_build_dib_packages }}" # Avoid needing to install qemu-img for qcow2 image. type: raw os_images_git_elements: "{{ ipa_build_dib_git_elements }}" diff --git a/ansible/seed-ipa-build.yml b/ansible/seed-ipa-build.yml index f1afb808e..1e2e0e413 100644 --- a/ansible/seed-ipa-build.yml +++ b/ansible/seed-ipa-build.yml @@ -27,6 +27,7 @@ - name: "{{ ipa_image_name }}" elements: "{{ ipa_build_dib_elements }}" env: "{{ ipa_build_dib_env }}" + packages: "{{ ipa_build_dib_packages }}" # Avoid needing to install qemu-img for qcow2 image. type: raw os_images_git_elements: "{{ ipa_build_dib_git_elements }}" diff --git a/doc/source/configuration/bifrost.rst b/doc/source/configuration/bifrost.rst index c24b2e50e..a8673a716 100644 --- a/doc/source/configuration/bifrost.rst +++ b/doc/source/configuration/bifrost.rst @@ -167,6 +167,20 @@ Alternatively, the :diskimage-builder-doc:`dynamic-login element ` can be used to authorize SSH keys by appending them to the kernel arguments. +Example: Installing a package +----------------------------- + +It can be necessary to install additional packages in the root disk image. +Rather than needing to write a custom DIB element, we can use the +``kolla_bifrost_dib_packages`` variable. For example, to install the +``biosdevname`` package: + +.. code-block:: yaml + :caption: ``ipa.yml`` + + kolla_bifrost_dib_packages: + - "biosdevname" + Ironic configuration ==================== diff --git a/doc/source/configuration/ironic-python-agent.rst b/doc/source/configuration/ironic-python-agent.rst index 74c8c4cef..c79b94189 100644 --- a/doc/source/configuration/ironic-python-agent.rst +++ b/doc/source/configuration/ironic-python-agent.rst @@ -66,6 +66,8 @@ image build``. List of git repositories containing Diskimage Builder (DIB) elements. See `stackhpc.os-images `__ role for usage. Default is none. +``ipa_build_dib_packages`` + List of DIB packages to install. Default is none. Example: Building IPA images locally ------------------------------------ @@ -156,6 +158,20 @@ In this example the ``master`` branch of https://git.example.com/custom-dib-elements would have a top level ``elements`` directory, containing a ``my-element`` directory for the element. +Example: Installing a package +----------------------------- + +It can be necessary to install additional packages in the IPA image. Rather +than needing to write a custom DIB element, we can use the +``ipa_build_dib_packages`` variable. For example, to install the +``biosdevname`` package: + +.. code-block:: yaml + :caption: ``ipa.yml`` + + ipa_build_dib_packages: + - "biosdevname" + Ironic Python Agent (IPA) images configuration ============================================== diff --git a/etc/kayobe/ipa.yml b/etc/kayobe/ipa.yml index a464c8316..2928e27e1 100644 --- a/etc/kayobe/ipa.yml +++ b/etc/kayobe/ipa.yml @@ -40,6 +40,9 @@ # stackhpc.os-images role for usage. #ipa_build_dib_git_elements: +# List of DIB packages to install. Default is none. +#ipa_build_dib_packages: + ############################################################################### # Ironic Python Agent (IPA) images configuration. diff --git a/releasenotes/notes/ipa-build-dib-packages-5e85baba3294eb65.yaml b/releasenotes/notes/ipa-build-dib-packages-5e85baba3294eb65.yaml new file mode 100644 index 000000000..02ef4ea3f --- /dev/null +++ b/releasenotes/notes/ipa-build-dib-packages-5e85baba3294eb65.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds support for installing packages in locally built Ironic Python Agent + (IPA) images via the ``ipa_build_dib_packages`` variable. See `story + 2006855 `__ for details. diff --git a/requirements.yml b/requirements.yml index 183fc6b82..cbb3d63b4 100644 --- a/requirements.yml +++ b/requirements.yml @@ -30,7 +30,7 @@ - src: stackhpc.mellanox-switch version: v1.0.0 - src: stackhpc.os-images - version: v1.4.0 + version: v1.6.0 - src: stackhpc.os-ironic-state version: v1.2.0 - src: stackhpc.os-networks