Skip to content

Fix build and rotation of amphora images on Rocky 9 #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions etc/kayobe/ansible/octavia-amphora-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
vars:
amphora_dib_upper_constraints_file: "{{ pip_upper_constraints_file }}"
tasks:
- name: Install EPEL
package:
name: epel-release
become: true
when: ansible_facts.os_family == "RedHat"

- name: Ensure packages are installed
become: true
vars:
Expand Down
16 changes: 12 additions & 4 deletions etc/kayobe/ansible/octavia-amphora-image-register.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
- name: Set up openstack virtualenv
pip:
virtualenv: "{{ venv }}"
virtualenv_command: python3 -m venv
name:
- openstacksdk
- python-openstackclient
state: latest
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
extra_args: "{% if openstacksdk_upper_constraints_file %}-c {{ openstacksdk_upper_constraints_file }}{% endif %}"

- name: Query Octavia Amphora image
vars:
Expand All @@ -39,7 +40,14 @@
checksum_algorithm: md5
changed_when: false
register: image_checksum
when: image_info.openstack_image
when: image_info.image

- name: Assert that Amphora image exists
assert:
that: image_checksum.stat.exists
fail_msg: |
The amphora image: {{ image_cache_path }}/amphora-x64-haproxy-{{ openstack_release }}.qcow2
does not exist. Did you build the image?

- name: Ensure Octavia Amphora image is renamed
vars:
Expand All @@ -48,8 +56,8 @@
cmd: >-
{{ venv }}/bin/openstack image set amphora-x64-haproxy --name amphora-x64-haproxy-{{ ansible_facts.date_time.iso8601_basic_short }}
when:
- image_info.openstack_image
- image_info.openstack_image.checksum != image_checksum.stat.checksum
- image_info.image
- image_info.image.checksum != image_checksum.stat.checksum
changed_when: true
environment: "{{ openstack_auth_env }}"

Expand Down