From 3e1feaa8e1c2cd184f78a3dec0b90aaea4bbc88f Mon Sep 17 00:00:00 2001 From: Ben Partridge Date: Tue, 12 Nov 2019 01:15:12 +0000 Subject: [PATCH] Hack to fix db restore with custom pg_dump format --- roles/restore_backups/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/restore_backups/tasks/main.yml b/roles/restore_backups/tasks/main.yml index c1587bd..1ed64f4 100644 --- a/roles/restore_backups/tasks/main.yml +++ b/roles/restore_backups/tasks/main.yml @@ -68,7 +68,8 @@ overwrite: different bucket: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('hostname') }}" object: "{{ atl_backup_manifest.artifacts.db.location.location | urlsplit('path') }}" - dest: "{{ atl_backup_db_dest }}" + # 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 }}.tar" - name: Fetch Home backup from S3 aws_s3: @@ -96,7 +97,9 @@ template: "{{ atl_jdbc_template }}" # Depends on fetch_backup roles state: restore - target: "{{ atl_backup_db_dest }}" + target: "{{ atl_backup_db_dest }}.tar" + # Overwrite the dump format to be psql custom + target_opts: "-Fc" when: db_created.changed and atl_backup_db_dest is defined