summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/manual/upgrade/bugyou.yml59
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
+