From c3ad168fb0d27ca6a5b6e40b7d33d44e309aa452 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 16 Sep 2020 11:30:23 +0200 Subject: [PATCH] staging-sync/db-sync: stop apache after having dumped the prod db Signed-off-by: Pierre-Yves Chibon --- playbooks/manual/staging-sync/db-sync.yml | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/playbooks/manual/staging-sync/db-sync.yml b/playbooks/manual/staging-sync/db-sync.yml index eb3325094d..c2828643b4 100644 --- a/playbooks/manual/staging-sync/db-sync.yml +++ b/playbooks/manual/staging-sync/db-sync.yml @@ -13,20 +13,6 @@ # Can be a full hostname (foo01.iad2.fp.o) or a group, foo-stg # db => The database name on both database server (must be the same) -- name: bring staging services down - hosts: "{{ server }}" - user: root - when: server is defined - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - handlers: - - import_tasks: "{{ handlers_path }}/restart_services.yml" - - tasks: - - service: name=httpd state=stopped - - name: dump the prod db out hosts: "{{ dbhost }}.iad2.fedoraproject.org" user: root @@ -51,6 +37,20 @@ dest: /var/tmp/ flat: yes +- name: bring staging services down + hosts: "{{ server }}" + user: root + when: server is defined + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + handlers: + - import_tasks: "{{ handlers_path }}/restart_services.yml" + + tasks: + - service: name=httpd state=stopped + - name: drop and re-create the staging db entirely hosts: "{{ dbhost }}.stg.iad2.fedoraproject.org" user: root