DCD-686: Only restore DB when it is a new one.

This commit is contained in:
Steve Smith
2019-10-09 15:29:58 +11:00
parent 9d8b47ba9e
commit 0400d8943d

View File

@@ -34,7 +34,7 @@
lc_collate: "{{ atl_jdbc_collation }}"
lc_ctype: "{{ atl_jdbc_ctype }}"
template: "{{ atl_jdbc_template }}"
when: atl_backup_db_dest is not defined
register: db_create
- name: Restore application database
postgresql_db:
@@ -51,8 +51,7 @@
# Depends on fetch_backup roles
state: restore
target: "{{ atl_backup_db_dest }}"
target_opts: "--no-owner --role={{ atl_jdbc_user }}"
when: atl_backup_db_dest is defined
when: db_create.changed and atl_backup_db_dest is defined
tags:
- new_only