diff --git a/playbooks/manual/upgrade/koschei.yml b/playbooks/manual/upgrade/koschei.yml index cc172719fd..50232157d6 100644 --- a/playbooks/manual/upgrade/koschei.yml +++ b/playbooks/manual/upgrade/koschei.yml @@ -1,5 +1,5 @@ -- name: upgrade koschei - hosts: koschei-stg:koschei +- name: upgrade koschei frontend + hosts: koschei-web-stg vars_files: - /srv/web/infra/ansible/vars/global.yml - /srv/private/ansible/vars.yml @@ -8,14 +8,40 @@ - include: "{{ handlers }}/restart_services.yml" roles: - koschei/frontend - - 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 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 service: name="{{ item }}" state=stopped with_items: @@ -23,7 +49,6 @@ - koschei-polling - koschei-resolver - koschei-watcher - - httpd - name: clean yum metadata command: yum clean all - name: upgrade koschei @@ -32,12 +57,29 @@ - koschei-admin - koschei-backend - koschei-backend-fedora - - koschei-frontend - name: run db migration become: yes become_user: koschei command: alembic -c /usr/share/koschei/alembic.ini upgrade head - post_tasks: - - name: start httpd - service: name="httpd" state=started +- name: restart koschei frontend + hosts: koschei-web-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/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