Install DIB dependencies in bifrost-ironic-install role

This provides a cleaner separation between installation and image
creation.

This allows Kolla to install all package dependencies at container image
build time rather than when using the container image to build disk
images.

Story: 2008839
Task: 42346

Change-Id: I5be8b355b92f0d9d907c743b522982f6de0398c1
This commit is contained in:
Mark Goddard 2021-04-22 10:28:19 +01:00
parent 33d0dc805d
commit c72dd2fd7b
7 changed files with 20 additions and 22 deletions

View File

@ -51,7 +51,7 @@ mysql_password:
# deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true
create_image_via_dib: "{{ not use_cirros | default(false) | bool }}"
dib_image_type: vm
# Create IPA image instead of downloading an pre-made IPA image.

View File

@ -51,7 +51,7 @@ mysql_password:
# deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true
create_image_via_dib: "{{ not use_cirros | default(false) | bool }}"
dib_image_type: vm
# Create IPA image instead of downloading an pre-made IPA image.

View File

@ -13,11 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: Ensure required packages are installed
package:
name: "{{ dib_host_required_packages }}"
state: present
when: not skip_package_install | bool
# If attempting to utilize a base Ubuntu image, diskimage-builder
# is the recommended, and default path.
- name: "Test if image is present"
@ -186,19 +181,6 @@
{{ dib_packages_arg|default('') }}
{{ dib_os_element }}
{{ dib_elements|default('') }}
- name: "Update package cache on Debian and Ubuntu"
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
- name: Install debootstrap if building a Debian image
package:
name: debootstrap
state: present
when:
- not test_image_present.stat.exists
- not test_image_dib_present.stat.exists
- not test_image_initramfs_present.stat.exists
- ("debian" in dib_os_element or "ubuntu" in dib_os_element)
- name: "Initiate image build"
command: disk-image-create {{ dib_arglist }}
environment: "{{ dib_env_vars_final | combine(bifrost_venv_env) }}"

View File

@ -21,10 +21,12 @@ sushy_source_install: false
staging_drivers_source_install: true
prometheus_exporter_source_install: true
# Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true
create_image_via_dib: "{{ not use_cirros | default(false) | bool }}"
create_ipa_image: false
dib_image_type: vm
dib_os_element: "debian"
# Setting to install diskimage-builder
install_dib: "{{ create_image_via_dib }}"
install_dib: "{{ create_image_via_dib | bool or create_ipa_image | bool }}"
ironic_debug: true
# If testing is true, then the environment is setup for using libvirt
# virtual machines for the hardware instead of real hardware.

View File

@ -51,6 +51,12 @@
source_install: true
when: install_dib | bool
- name: Ensure required packages are installed
package:
name: "{{ dib_host_required_packages | select | list }}"
state: present
when: install_dib | bool
- name: "sushy - Install"
include_role:
name: bifrost-pip-install

View File

@ -18,3 +18,4 @@ dib_host_required_packages:
- gdisk
- "squashfs{% if ansible_os_family != 'Suse' %}-tools{% endif %}"
- xfsprogs
- "{% if 'debian' in dib_os_element or 'ubuntu' in dib_os_element %}debootstrap{% endif %}"

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Moves installation of package dependencies for Diskimage Builder (DIB) from
the ``bifrost-create-dib-image`` role to the ``bifrost-install-ironic``
role. This provides a cleaner separation between installation and image
creation.