Add a fedimg upgrade playbook.

This commit is contained in:
Ralph Bean 2015-10-16 18:03:24 +00:00
parent 0f39d6881b
commit 3d83e48447

View file

@ -0,0 +1,48 @@
- name: push packages out
hosts: fedimg;fedimg-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 fedimg packages from main repo
yum: name="python-fedimg" state=latest
when: not testing
- name: yum update fedimg packages from testing repo
yum: name="python-fedimg" state=latest enablerepo=infrastructure-testing
when: testing
- name: verify the backend and restart it
hosts: fedimg;fedimg-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
nagios: action=downtime minutes=60 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.phx2.fedoraproject.org
ignore_errors: true
roles:
- fedimg
post_tasks:
- service: name="fedmsg-hub" state=restarted
- name: tell nagios to unshush
nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.phx2.fedoraproject.org
ignore_errors: true