kayobe/ansible/overcloud-host-image-build.yml
Rafal Lewandowski e10f176ce1 Add new DIB upper constraints variables
overcloud-dib: added overcloud_dib_dib_upper_constraints_file
ipa: added ipa_build_dib_upper_constraints_file
added os_images_dib_upper_constraints_file to image build
playbooks

New variables were added to facilitate control over the DIB
upper constraints without changing them for other components.
They are empty by default in order to facilitate Rocky9
image builds.

Change-Id: Ib50dd61685f13c60ace67213ddd1e714a80dece3
2022-09-13 11:23:58 +02:00

47 lines
2.1 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_dib_upper_constraints_file: "{{ overcloud_dib_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