Skip to content

Commit

Permalink
Always check and wait for a restore pg_restore to finish (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
rooftopcellist authored Dec 1, 2023
1 parent e3e3da0 commit a61ed18
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion roles/installer/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}"
Expand Down

0 comments on commit a61ed18

Please sign in to comment.