diff options
author | Sayan Chowdhury <sayan.chowdhury2012@gmail.com> | 2016-10-28 10:39:12 +0530 |
---|---|---|
committer | Sayan Chowdhury <sayanchowdhury@fedoraproject.org> | 2016-10-28 05:47:59 +0000 |
commit | da01e57907d97f8952f5c8a1f95f23c448c506db (patch) | |
tree | d8a445d86a49b762452a37c55ee4472026b38717 | |
parent | bf40ac604d2b4120e24a38e88d7e01b8bd6b9bb4 (diff) | |
download | ansible-da01e57907d97f8952f5c8a1f95f23c448c506db.tar.gz ansible-da01e57907d97f8952f5c8a1f95f23c448c506db.tar.xz ansible-da01e57907d97f8952f5c8a1f95f23c448c506db.zip |
Add manual upgrade playbook for bugyou
-rw-r--r-- | playbooks/manual/upgrade/bugyou.yml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/playbooks/manual/upgrade/bugyou.yml b/playbooks/manual/upgrade/bugyou.yml new file mode 100644 index 000000000..6d2e058ed --- /dev/null +++ b/playbooks/manual/upgrade/bugyou.yml @@ -0,0 +1,59 @@ +- name: push packages out + hosts: bugyou:bugyou-stg + user: root + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + vars: + testing: False + handlers: + - include: "{{ handlers }}/restart_services.yml" + + tasks: + - name: clean all metadata {%if testing%}(with infrastructure-testing on){%endif%} + command: yum clean all {%if testing%} --enablerepo=infrastructure-testing {%endif%} + always_run: yes + - name: yum update bugyou packages from main repo + yum: name="bugyou*" state=latest + when: not testing + - name: yum update bugyou packages from testing repo + yum: name="bugyou*" state=latest enablerepo=infrastructure-testing + when: testing + +- name: verify the backends, stop them, and then upgrade the db + hosts: bugyou:bugyou-stg + user: root + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + handlers: + - include: "{{ handlers }}/restart_services.yml" + + pre_tasks: + - name: tell nagios to shush w.r.t. the backend + nagios: action=downtime minutes=15 service=host host={{ inventory_hostname_short }}{{ env_suffix }} + delegate_to: noc01.phx2.fedoraproject.org + ignore_errors: true + + roles: + - bugyou/backend + + tasks: + - name: Stop the fedmsg-hub backend + service: name="fedmsg-hub" state=stopped + - name: Stop the bugyou controller backend + service: name="bugyou-cntrl" state=stopped + + - name: And... start the bugyou controller backend again + service: name="bugyou-cntrl" state=started + - name: And... start the fedmsg-hub backend again + service: name="fedmsg-hub" state=started + + post_tasks: + - name: tell nagios to unshush w.r.t. the backend + nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }} + delegate_to: noc01.phx2.fedoraproject.org + ignore_errors: true + |