diff --git a/roles/database_init/tasks/main.yml b/roles/database_init/tasks/main.yml index ec5ce38..aa8da99 100644 --- a/roles/database_init/tasks/main.yml +++ b/roles/database_init/tasks/main.yml @@ -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