From fb8b70778abcb8a5fb438f8597f92dd539fa5dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Wed, 9 Oct 2019 11:54:44 +0200 Subject: [PATCH] Bodhi 5: stop and start the new service as well during manual operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- playbooks/manual/staging-sync/bodhi.yml | 12 +++++++++--- playbooks/manual/upgrade/bodhi.yml | 26 +++++++++++++++---------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/playbooks/manual/staging-sync/bodhi.yml b/playbooks/manual/staging-sync/bodhi.yml index 8763bdc463..8ec1fdde5f 100644 --- a/playbooks/manual/staging-sync/bodhi.yml +++ b/playbooks/manual/staging-sync/bodhi.yml @@ -35,8 +35,11 @@ tasks: - service: - name: fm-consumer@config.service + name: "{{ item }}" state: stopped + with_items: + - fm-consumer@config.service + - bodhi-celery # Here's the meaty part in the middle - name: drop and re-create the staging db entirely @@ -98,5 +101,8 @@ tasks: - service: - name: fm-consumer@config.service - state: started + name: "{{ item }}" + state: stopped + with_items: + - fm-consumer@config.service + - bodhi-celery diff --git a/playbooks/manual/upgrade/bodhi.yml b/playbooks/manual/upgrade/bodhi.yml index 31c25c582b..c0c498b3fa 100644 --- a/playbooks/manual/upgrade/bodhi.yml +++ b/playbooks/manual/upgrade/bodhi.yml @@ -1,7 +1,7 @@ - name: check to see if a compose is going on before we do anything... hosts: bodhi_backend:bodhi_backend_stg user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml @@ -21,7 +21,7 @@ - name: push packages out hosts: bodhi_backend:bodhi_backend_stg user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml @@ -47,7 +47,7 @@ - name: find out if there are migrations to run hosts: bodhi_backend:bodhi_backend_stg user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml @@ -60,7 +60,7 @@ - name: Stop the front end if there are migrations to run hosts: os_masters[0]:os_masters_stg[0] user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml @@ -84,7 +84,7 @@ - name: verify the backends, stop them, and then upgrade the db hosts: bodhi_backend:bodhi_backend_stg user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml @@ -101,20 +101,26 @@ - bodhi2/backend tasks: - - name: Stop the fedora-messaging backend + - name: Stop the backend services service: - name: fm-consumer@config.service + name: "{{ item }}" state: stopped + with_items: + - fm-consumer@config.service + - bodhi-celery - name: Upgrade the database command: /usr/bin/alembic-3 -c /etc/bodhi/alembic.ini upgrade head args: chdir: /usr/share/bodhi/ - - name: Start the fedora-messaging backend + - name: Start the backend services service: - name: fm-consumer@config.service + name: "{{ item }}" state: started + with_items: + - fm-consumer@config.service + - bodhi-celery post_tasks: - name: tell nagios to unshush w.r.t. the backend @@ -125,7 +131,7 @@ - name: restart the frontend hosts: os_masters[0]:os_masters_stg[0] user: root - vars_files: + vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml