From 80e72f481b3e6ab4aa0eb8c6fae72c9db54fc188 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 16 Dec 2014 19:57:42 +0000 Subject: [PATCH] Combine delegate_to and with_items so we only run update-dns if we actually have a proxy to change. --- playbooks/update-proxy-dns.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/playbooks/update-proxy-dns.yml b/playbooks/update-proxy-dns.yml index 5804439e52..b952e21294 100644 --- a/playbooks/update-proxy-dns.yml +++ b/playbooks/update-proxy-dns.yml @@ -41,19 +41,10 @@ - name: Destroy our temporary clone of /git/dns/ in /var/tmp/dns-checkout.... local_action: file dest={{tmp.stdout}} state=absent -- name: Run update-dns on the nameservers - 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 + - name: Run update-dns on each nameserver command: /usr/local/bin/update-dns + delegate_to: "{{item}}" + with_items: groups.dns - name: Wait for dns to percolate (5 minutes) pause: minutes=5