DEV-1066: added additional steps to DROP and RECREATE database in case of restore.

qa
Görz, Friedrich 3 years ago
parent f5aa1949f8
commit e6eb863684

@ -8,6 +8,30 @@
group: "postgres"
mode: '0755'
- name: "Restore database ... "
block:
- name: "Restore | DROP database with suffix <{{ custom_backup_name }}>"
community.postgresql.postgresql_db:
name: "{{ item.name }}"
state: absent
force: true
loop: "{{ postgres_acls }}"
become_user: postgres
become: true
- name: "Restore | RECREATE database with suffix <{{ custom_backup_name }}>"
community.postgresql.postgresql_db:
name: "{{ item.name }}"
force: true
loop: "{{ postgres_acls }}"
become_user: postgres
become: true
when:
- database_backup_state is defined
- database_backup_state in ['restore']
- name: "Handle backup state <{{ database_backup_state }}> with suffix <{{ custom_backup_name }}>"
community.postgresql.postgresql_db:
name: "{{ item.name }}"

Loading…
Cancel
Save