Files
octavia/playbooks/image-build/run.yaml
Michael Johnson d682e74d33 Fix amphora image builds to use DIB bindep
The amphora image builds are currently failing because we are trying to
install the binary packages for diskimage-builder ourselves in the
ansible for the job. This patch changes that to use the bindep.txt
included with diskimage-builder.

Change-Id: I8e489b251ff0e58809b66c0145023769abef6e68
2024-09-11 20:14:20 +00:00

46 lines
1.6 KiB
YAML

- hosts: all
tasks:
# Workaround for Red Hat like distros: SELinux prevents diskimage-builder
# from creating a RPM DB dir in a chroot on Centos 9 Stream
- name: Disable SELinux on Red Hat distributions
selinux:
state: disabled
become: yes
when:
- ansible_os_family == 'RedHat'
- name: Install required pip packages
pip:
name: "{{ item }}"
state: "latest"
virtualenv: /var/tmp/venv
virtualenv_command: python3 -m venv
register: install_packages
until: install_packages is success
retries: 5
delay: 2
become: yes
with_items:
- bindep
- diskimage-builder
- setuptools
- name: Install binary dependencies from diskimage-builder
include_role:
name: bindep
vars:
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/diskimage-builder'].src_dir }}"
- name: Ensure artifacts/images directory exists
file:
path: '{{ ansible_user_dir }}/test-images'
state: directory
- name: Build an amphora image for publishing
shell: >-
. /var/tmp/venv/bin/activate && \
./diskimage-create.sh -o {{ ansible_user_dir }}/test-images/test-only-amphora-x64-haproxy-{{ amphora_os }}-{{ amphora_os_release }}.qcow2 \
-i {{ amphora_os }} \
-d {{ amphora_os_release }} \
-s {{ amphora_image_size | default(2) }}
args:
chdir: "{{ ansible_user_dir }}/src/opendev.org/openstack/octavia/diskimage-create"
tags:
- skip_ansible_lint