Merge branch 'master' of /git/ansible

* 'master' of /git/ansible:
  Update koschei upgrade playbook
This commit is contained in:
Adam Miller 2016-04-15 13:28:34 +00:00
commit 8f75c0fe3d

View file

@ -1,5 +1,5 @@
- name: upgrade koschei - name: upgrade koschei frontend
hosts: koschei-stg:koschei hosts: koschei-web-stg
vars_files: vars_files:
- /srv/web/infra/ansible/vars/global.yml - /srv/web/infra/ansible/vars/global.yml
- /srv/private/ansible/vars.yml - /srv/private/ansible/vars.yml
@ -8,14 +8,40 @@
- include: "{{ handlers }}/restart_services.yml" - include: "{{ handlers }}/restart_services.yml"
roles: roles:
- koschei/frontend - koschei/frontend
- koschei/backend
pre_tasks: pre_tasks:
- name: schedule nagios downtime - name: schedule nagios downtime
nagios: action=downtime minutes=20 service=host host={{ inventory_hostname_short }}{{ env_suffix }} nagios: action=downtime minutes=20 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.phx2.fedoraproject.org delegate_to: noc01.phx2.fedoraproject.org
ignore_errors: true ignore_errors: true
when: env != 'staging' when: env != 'staging'
tasks:
- name: stop httpd
service: name="httpd" state=stopped
- name: clean yum metadata
command: yum clean all
- name: upgrade koschei
package: name="{{ item }}" state=latest
with_items:
- koschei-frontend
- koschei-frontend-fedora
- name: upgrade koschei backend and run DB migration
hosts: koschei-backend-stg
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"
roles:
- koschei/backend
pre_tasks:
- name: schedule nagios downtime
nagios: action=downtime minutes=20 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.phx2.fedoraproject.org
ignore_errors: true
when: env != 'staging'
tasks:
- name: stop services - name: stop services
service: name="{{ item }}" state=stopped service: name="{{ item }}" state=stopped
with_items: with_items:
@ -23,7 +49,6 @@
- koschei-polling - koschei-polling
- koschei-resolver - koschei-resolver
- koschei-watcher - koschei-watcher
- httpd
- name: clean yum metadata - name: clean yum metadata
command: yum clean all command: yum clean all
- name: upgrade koschei - name: upgrade koschei
@ -32,12 +57,29 @@
- koschei-admin - koschei-admin
- koschei-backend - koschei-backend
- koschei-backend-fedora - koschei-backend-fedora
- koschei-frontend
- name: run db migration - name: run db migration
become: yes become: yes
become_user: koschei become_user: koschei
command: alembic -c /usr/share/koschei/alembic.ini upgrade head command: alembic -c /usr/share/koschei/alembic.ini upgrade head
post_tasks: - name: restart koschei frontend
- name: start httpd hosts: koschei-web-stg
service: name="httpd" state=started 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"
roles:
- koschei/frontend
- name: restart koschei-backend
hosts: koschei-backend-stg
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"
roles:
- koschei/backend