From 2384341514bf8b51a675065b7b31792d3b9cd87b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 16 Sep 2020 12:03:06 +0200 Subject: [PATCH] staging-sync/db-sync: Name a few more tasks to have a nicer output Signed-off-by: Pierre-Yves Chibon --- playbooks/manual/staging-sync/db-sync.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/playbooks/manual/staging-sync/db-sync.yml b/playbooks/manual/staging-sync/db-sync.yml index 9af4e06051..c34604d17c 100644 --- a/playbooks/manual/staging-sync/db-sync.yml +++ b/playbooks/manual/staging-sync/db-sync.yml @@ -33,7 +33,8 @@ shell: pg_dump -C {{ db }} |xz -c > /var/tmp/{{ db }}.dump.xz # Get the dump from `from` in the batcave - - fetch: + - name: Export the dump from the dbhost in prod to batcave + fetch: src: /var/tmp/{{ db }}.dump.xz dest: /var/tmp/ flat: yes @@ -70,16 +71,22 @@ tasks: # push dump to stg from batcave - - copy: + - name: push the DB dump from batcave to the dbhost in stg + copy: src: /var/tmp/{{ db }}.dump.xz dest: /var/tmp/{{ db }}.dump.xz - - command: unxz /var/tmp/{{ db }}.dump.xz + - name: Unpack the archive + command: unxz /var/tmp/{{ db }}.dump.xz creates=/var/tmp/{{ db }}.dump - - command: dropdb {{ db }} + - name: Drop the postgresql database in staging + command: dropdb {{ db }} ignore_errors: yes - - command: createdb {{ db }} + + - name: Create the postgresql database in staging + command: createdb {{ db }} + - name: Import the prod db. This will take quite a while. Go get a snack! shell: cat /var/tmp/{{ db }}.dump | psql {{ db }} @@ -129,5 +136,6 @@ - import_tasks: "{{ handlers_path }}/restart_services.yml" tasks: - - command: rm -f /var/tmp/{{ db }}.dump.xz + - name: remove the DB dump from batcave + command: rm -f /var/tmp/{{ db }}.dump.xz