Files
kayobe/ansible/overcloud-host-image-build.yml
Mark Goddard 0e4af118eb Support additional build host packages for IPA & overcloud
Adds support for installing additional build host dependencies when
building IPA and overcloud host images via
'ipa_build_dib_host_packages_extra' and
'overcloud_dib_host_packages_extra'.

Support for installing additional host packages was added in
stackhpc.os-images v1.15.0 [1].

[1] https://github.com/stackhpc/ansible-role-os-images/pull/63

Change-Id: I1a05d448031cb415cec4cd601a030abdb8a5eba5
2022-08-22 15:24:55 +02:00

46 lines
2.0 KiB
YAML

---
# Build and install overcloud host disk images for the seed host's ironic
# service.
- name: Ensure overcloud host disk images are built and installed
hosts: seed
tags:
- overcloud-host-image-build
vars:
overcloud_host_image_force_rebuild: False
tasks:
- block:
- name: Validate overcloud host disk image configuration
assert:
that:
- overcloud_dib_host_images is sequence
- overcloud_dib_host_images | selectattr('name', 'undefined') | list | length == 0
- overcloud_dib_host_images | selectattr('elements', 'undefined') | list | length == 0
msg: "overcloud_dib_host_images set to invalid value"
- name: Ensure overcloud host disk images are built
include_role:
name: stackhpc.os-images
vars:
os_images_package_dependencies_extra: "{{ overcloud_dib_host_packages_extra | select | list }}"
os_images_venv: "{{ virtualenv_path }}/overcloud-host-image-dib"
os_images_package_state: latest
os_images_upper_constraints_file: "{{ overcloud_dib_upper_constraints_file }}"
os_images_cache: "{{ image_cache_path }}"
os_images_common: ""
os_images_list: "{{ overcloud_dib_host_images }}"
os_images_git_elements: "{{ overcloud_dib_git_elements }}"
os_images_upload: False
os_images_force_rebuild: "{{ overcloud_host_image_force_rebuild }}"
- name: Copy overcloud host disk images into /httpboot
copy:
src: "{{ image_cache_path }}/{{ image.name }}/{{ image.name }}.{{ image.type | default('qcow2') }}"
dest: "/var/lib/docker/volumes/bifrost_httpboot/_data/{{ image.name }}.{{ image.type | default('qcow2') }}"
remote_src: True
with_items: "{{ overcloud_dib_host_images }}"
loop_control:
loop_var: image
become: True
when: overcloud_dib_build_host_images | bool