Combine delegate_to and with_items so we only run update-dns if we actually have a proxy to change.
This commit is contained in:
parent
9f23ed1b7c
commit
80e72f481b
1 changed files with 3 additions and 12 deletions
|
@ -41,19 +41,10 @@
|
||||||
- name: Destroy our temporary clone of /git/dns/ in /var/tmp/dns-checkout....
|
- name: Destroy our temporary clone of /git/dns/ in /var/tmp/dns-checkout....
|
||||||
local_action: file dest={{tmp.stdout}} state=absent
|
local_action: file dest={{tmp.stdout}} state=absent
|
||||||
|
|
||||||
- name: Run update-dns on the nameservers
|
- name: Run update-dns on each nameserver
|
||||||
hosts: dns
|
|
||||||
user: root
|
|
||||||
gather_facts: False
|
|
||||||
vars_files:
|
|
||||||
- /srv/web/infra/ansible/vars/global.yml
|
|
||||||
- "{{ private }}/vars.yml"
|
|
||||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
- name: Run update-dns
|
|
||||||
command: /usr/local/bin/update-dns
|
command: /usr/local/bin/update-dns
|
||||||
|
delegate_to: "{{item}}"
|
||||||
|
with_items: groups.dns
|
||||||
|
|
||||||
- name: Wait for dns to percolate (5 minutes)
|
- name: Wait for dns to percolate (5 minutes)
|
||||||
pause: minutes=5
|
pause: minutes=5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue