kayobe/ansible/overcloud-host-image-build.yml
Pierre Riteau ad3f6f10a2 Add overcloud_dib_upper_constraints_file variable
This variable allows to customise the upper constraints file used to
install packages inside the overcloud-host-image-dib virtual
environment. This can be used when we need a newer version of
diskimage-builder than the one available in upper constraints for the
current release.

Change-Id: I2f6c2f92903815973865ef0f5d6b867d5b995bd5
Story: 2002098
Task: 44101
2021-12-01 06:27:55 +01:00

52 lines
2.0 KiB
YAML

---
# Build and install a overcloud host disk image for the seed host's ironic
# service.
- name: Ensure overcloud host disk image is built and installed
hosts: seed
tags:
- overcloud-host-image-build
vars:
overcloud_host_image_name: "deployment_image"
overcloud_host_disk_images:
- "{{ overcloud_host_image_name }}.qcow2"
overcloud_host_image_force_rebuild: False
tasks:
- block:
- name: Ensure overcloud host disk image is built
include_role:
name: stackhpc.os-images
vars:
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:
- name: "{{ overcloud_host_image_name }}"
elements: "{{ overcloud_dib_elements }}"
env: "{{ overcloud_dib_env_vars }}"
packages: "{{ overcloud_dib_packages }}"
type: qcow2
os_images_upload: False
os_images_force_rebuild: "{{ overcloud_host_image_force_rebuild }}"
- name: Ensure overcloud host disk image is copied onto seed
copy:
src: "{{ image_cache_path }}/{{ overcloud_host_image_name }}/{{ item }}"
dest: "/etc/kolla/bifrost/{{ item }}"
remote_src: True
with_items: "{{ overcloud_host_disk_images }}"
become: True
- name: Copy overcloud host disk image into /httpboot
command: >
docker exec bifrost_deploy
bash -c 'ansible -vvvv target
-i /bifrost/playbooks/inventory/target
-m copy
-a "src=/etc/bifrost/{{ item }} dest=/httpboot/{{ item }}"
-e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python"'
with_items: "{{ overcloud_host_disk_images }}"
when: overcloud_dib_build_host_images | bool