Use inventory group names in anitya upgrade playbook

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
This commit is contained in:
Jeremy Cline 2017-02-16 13:43:51 +00:00
parent 99a671a8d1
commit 2860686a1f

View file

@ -1,5 +1,5 @@
- name: push packages out - name: push packages out
hosts: anitya-frontend01:anitya-backend01 hosts: anitya-frontend:anitya-backend
user: root user: root
vars_files: vars_files:
- /srv/web/infra/ansible/vars/global.yml - /srv/web/infra/ansible/vars/global.yml
@ -19,7 +19,7 @@
when: testing when: testing
- name: verify the frontend - name: verify the frontend
hosts: anitya-frontend01 hosts: anitya-frontend
user: root user: root
vars_files: vars_files:
- /srv/web/infra/ansible/vars/global.yml - /srv/web/infra/ansible/vars/global.yml
@ -42,7 +42,7 @@
ignore_errors: true ignore_errors: true
- name: verify the backend and then upgrade the db - name: verify the backend and then upgrade the db
hosts: anitya-backend01 hosts: anitya-backend
user: root user: root
vars_files: vars_files:
- /srv/web/infra/ansible/vars/global.yml - /srv/web/infra/ansible/vars/global.yml
@ -63,7 +63,7 @@
command: /usr/bin/alembic -c /usr/share/anitya/alembic.ini upgrade head command: /usr/bin/alembic -c /usr/share/anitya/alembic.ini upgrade head
args: args:
chdir: /usr/share/anitya/ chdir: /usr/share/anitya/
when: inventory_hostname.startswith('anitya-backend01') when: inventory_hostname.startswith('anitya-backend')
post_tasks: post_tasks:
- name: tell nagios to unshush w.r.t. the backend - name: tell nagios to unshush w.r.t. the backend
nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }} nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }}