Add a playbook for upgrading fmn.
This commit is contained in:
parent
d1be2cc882
commit
5bdbcf53cf
1 changed files with 71 additions and 0 deletions
71
playbooks/manual/upgrade/fmn.yml
Normal file
71
playbooks/manual/upgrade/fmn.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
# TODO disable and re-enable nagios
|
||||
- name: push packages out
|
||||
hosts: notifs-backend;notifs-backend-stg;notifs-web;notifs-web-stg
|
||||
user: root
|
||||
accelerate: "{{ accelerated }}"
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "{{ private }}/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
vars:
|
||||
testing: False
|
||||
|
||||
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 FMN packages from main repo
|
||||
yum: name="python-fmn*" state=latest
|
||||
when: not testing
|
||||
- name: yum update FMN packages from testing repo
|
||||
yum: name="python-fmn*" state=latest enablerepo=infrastructure-testing
|
||||
when: testing
|
||||
|
||||
- name: verify the frontend and stop it
|
||||
hosts: notifs-web;notifs-web-stg
|
||||
user: root
|
||||
accelerate: "{{ accelerated }}"
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "{{ private }}/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
roles:
|
||||
- notifs/frontend
|
||||
|
||||
tasks:
|
||||
- service: name="httpd" state=stopped
|
||||
|
||||
- name: verify the backend, stop it, and then upgrade the db
|
||||
hosts: notifs-backend;notifs-backend-stg
|
||||
user: root
|
||||
accelerate: "{{ accelerated }}"
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "{{ private }}/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
roles:
|
||||
- notifs/backend
|
||||
|
||||
tasks:
|
||||
- name: Stop the notification backend
|
||||
service: name="fedmsg-hub" state=stopped
|
||||
- name: Upgrade the database
|
||||
command: /usr/bin/alembic upgrade head
|
||||
args:
|
||||
chdir: /usr/share/fmn.lib/
|
||||
- name: And... start the backend again
|
||||
service: name="fedmsg-hub" state=started
|
||||
|
||||
- name: restart the frontend
|
||||
hosts: notifs-web;notifs-web-stg
|
||||
user: root
|
||||
accelerate: "{{ accelerated }}"
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "{{ private }}/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
tasks:
|
||||
- service: name="httpd" state=started
|
Loading…
Add table
Add a link
Reference in a new issue