From bcd631f6add2da69d526c3ae74d3efa815075138 Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Wed, 12 Oct 2022 13:46:02 +0200 Subject: [PATCH] Ensure that octavia-amphora-image is installed We had expected that octavia-amphora-image was always installed when deploying Octavia (it was pulled by the rhos-director-images RPM) but when deploying an UEFI overcloud, the package is not installed. This commits adds a task that ensures the octavia-amphora-image package is installed if: - the user doesn't specify another image path - the RPM is available (the RPM doesn't exist in RDO - tripleo CI jobs download the image in an other ansible playbook) wallaby-backport-potential Resolves: rhbz#2132889 Change-Id: Ic5fafe54f84fd934839c340b2f7bb5455d8b8639 --- .../roles/octavia_undercloud/tasks/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tripleo_ansible/roles/octavia_undercloud/tasks/main.yml b/tripleo_ansible/roles/octavia_undercloud/tasks/main.yml index 52ae41659..c3bdcc470 100644 --- a/tripleo_ansible/roles/octavia_undercloud/tasks/main.yml +++ b/tripleo_ansible/roles/octavia_undercloud/tasks/main.yml @@ -21,6 +21,20 @@ - ansible_facts['distribution'] == 'RedHat' - not (image_filename is defined) +# If the image path was not defined by the user, ensure that the RPM is +# installed. +# Ignore errors if the package doesn't exist (RDO CI). +- name: Ensure amphora image RPM in installed + package: + name: octavia-amphora-image + state: present + ignore_errors: true + vars: + # override the ansible_become variable from the inventory + ansible_become: true + when: + - amp_image_filename is not defined or (amp_image_filename | length) < 1 + - name: check if amphora image file exists stat: path: "{{ image_filename }}"