diff --git a/roles/set_openstack_containers/tasks/main.yml b/roles/set_openstack_containers/tasks/main.yml index 92d79eb85..ee19675c1 100644 --- a/roles/set_openstack_containers/tasks/main.yml +++ b/roles/set_openstack_containers/tasks/main.yml @@ -119,6 +119,31 @@ - operator_name != 'openstack' - not cifmw_architecture_scenario is defined +# Wait for 4 minutes so openstack-operator can be restarted in consecuence +# of reinstalating the meta operator +# It will get the current value of rabbitmq image and wait until it's updated +# with the value set by the update_env_vars.sh script +- name: Wait for openstack-operator to contain the new image values + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + PATH: "{{ cifmw_path }}" + ansible.builtin.shell: + cmd: | + set -o pipefail + oc get \ + --namespace={{ operator_namespace }} \ + $(oc get pod -l app.kubernetes.io/name=openstack-operator --no-headers=true -o name) \ + -o json | \ + jq -r '.spec.containers[].env[] | select(.name == "RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT") | .value' | \ + grep -q {{ cifmw_set_openstack_containers_tag }} \ + register: rabbitmq_image + until: rabbitmq_image.rc == 0 + retries: 24 + delay: 10 + when: + - operator_name == 'openstack' + - not cifmw_architecture_scenario is defined + - name: Retrieve operator pods environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"