From e3943b0e52398630cb8b532421c86531955c563a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 16 Sep 2020 11:52:37 +0200 Subject: [PATCH] staging-sync/db-sync: Allow the deletion of the stg database to fail without breaking the playbook Signed-off-by: Pierre-Yves Chibon --- playbooks/manual/staging-sync/db-sync.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/manual/staging-sync/db-sync.yml b/playbooks/manual/staging-sync/db-sync.yml index 10ba715d49..badb8c27ac 100644 --- a/playbooks/manual/staging-sync/db-sync.yml +++ b/playbooks/manual/staging-sync/db-sync.yml @@ -10,7 +10,8 @@ # server => The application server where apache will be turned off during the # sync. /!\ it should be the *stg* server, not prod (the one you want # to load the new DB for) -# Can be a full hostname (foo01.iad2.fp.o) or a group, foo-stg +# Can be a full hostname (foo01.iad2.fp.o) or a group (foo-stg) or an +# emptry string (''), for example if the app is running in openshift. # db => The database name on both database server (must be the same) - name: dump the prod db out @@ -76,6 +77,7 @@ creates=/var/tmp/{{ db }}.dump - command: dropdb {{ db }} + ignore_errors: yes - 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 }}