fedora-ansible/playbooks/manual/upgrade/fmn.yml

68 lines
1.9 KiB
YAML

# TODO disable and re-enable nagios
- name: push packages out
hosts: notifs-backend;notifs-backend-stg;notifs-web;notifs-web-stg
user: root
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
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
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
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