From a61ed181472c698bbd71374775ab1c710a29679d Mon Sep 17 00:00:00 2001 From: Christian Adams Date: Fri, 1 Dec 2023 16:18:23 -0500 Subject: [PATCH] Always check and wait for a restore pg_restore to finish (#1652) --- roles/installer/tasks/install.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/roles/installer/tasks/install.yml b/roles/installer/tasks/install.yml index f68eb1d1..207e8c88 100644 --- a/roles/installer/tasks/install.yml +++ b/roles/installer/tasks/install.yml @@ -77,6 +77,20 @@ - ingress_type | lower == 'route' - route_tls_secret != '' +- name: Wait for {{ deployment_type }}restore to complete + kubernetes.core.k8s_info: + api_version: "{{ api_version }}" + kind: "{{ deployment_type }}restore" + namespace: "{{ ansible_operator_meta.namespace }}" + register: restore_status_check + until: + # yamllint disable-line rule:line-length + - (restore_status_check.resources | length == 0) or (restore_status_check.resources | selectattr('spec.deployment_name', 'equalto', ansible_operator_meta.name) | map(attribute='status') | selectattr('restoreComplete', 'defined') | map(attribute='restoreComplete') | list | length > 0) + delay: 10 + retries: 8640 + ignore_errors: yes + changed_when: false + - name: Include resources configuration tasks include_tasks: resources_configuration.yml @@ -91,7 +105,7 @@ when: awx_task_pod_name != '' register: database_check -- name: Migrate the database if the K8s resources were updated. # noqa 305 +- name: Migrate the database if the K8s resources were updated # noqa 305 k8s_exec: namespace: "{{ ansible_operator_meta.namespace }}" pod: "{{ awx_task_pod_name }}"