Merge branch 'DCD-803-ignore-extension-comment' into DCD-798-fix-for-pg_dump-cusstom-format

# Conflicts:
#	roles/restore_backups/tasks/main.yml
This commit is contained in:
Adam Brokes
2019-11-13 14:53:13 +11:00

View File

@@ -68,8 +68,7 @@
overwrite: different overwrite: different
bucket: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('hostname') }}" bucket: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('hostname') }}"
object: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('path') }}" object: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('path') }}"
# We write it as tar because that will force the postgresql_db module to use pg_dump rather than psql dest: "{{ atl_backup_db_dest }}"
dest: "{{ atl_backup_db_dest }}.tar"
- name: Fetch Home backup from S3 - name: Fetch Home backup from S3
aws_s3: aws_s3:
@@ -97,9 +96,11 @@
template: "{{ atl_jdbc_template }}" template: "{{ atl_jdbc_template }}"
# Depends on fetch_backup roles # Depends on fetch_backup roles
state: restore state: restore
target: "{{ atl_backup_db_dest }}.tar" target: "{{ atl_backup_db_dest }}"
# Overwrite the dump format to be psql custom register: result
target_opts: "-Fc" failed_when:
- result.rc != 0
- "COMMENT ON EXTENSION" not in result.msg
when: db_created.changed and atl_backup_db_dest is defined when: db_created.changed and atl_backup_db_dest is defined