From 18c55fa8b384c88203c25798d6495fbb48a9db4b Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 8 Oct 2015 18:34:30 +0000 Subject: [PATCH] Add a datagrepper upgrade playbook. --- playbooks/manual/upgrade/datagrepper.yml | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 playbooks/manual/upgrade/datagrepper.yml diff --git a/playbooks/manual/upgrade/datagrepper.yml b/playbooks/manual/upgrade/datagrepper.yml new file mode 100644 index 0000000000..3afc6ad977 --- /dev/null +++ b/playbooks/manual/upgrade/datagrepper.yml @@ -0,0 +1,49 @@ +- name: push packages out + hosts: datagrepper;datagrepper-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 datagrepper packages from main repo + yum: name="datagrepper" state=latest + when: not testing + - name: yum update datagrepper packages from testing repo + yum: name="datagrepper" state=latest enablerepo=infrastructure-testing + when: testing + +- name: verify the config and restart it + hosts: datagrepper;datagrepper-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: + - datagrepper + + post_tasks: + - service: name="httpd" 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