From 64cb5ea025ce994a2c76d92bc4521195beb6f023 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 15 Dec 2014 21:46:17 +0000 Subject: [PATCH] Use a real tmpdir. --- playbooks/update-proxy-dns.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/playbooks/update-proxy-dns.yml b/playbooks/update-proxy-dns.yml index 85938c0b12..c7eb18be24 100644 --- a/playbooks/update-proxy-dns.yml +++ b/playbooks/update-proxy-dns.yml @@ -13,30 +13,33 @@ - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml vars: - - gitdir: /var/tmp/dns-checkout - userstring: "Ansible update-proxy-dns.yml " tasks: - - name: Clone the dns repo into /var/tmp/ - local_action: git repo=/git/dns/ dest={{gitdir}} + - name: Make up a tempdir.. + local_action: command mktemp -p /var/tmp -d dns-checkout.XXXXXXXX + register: tmp - - name: Run zone-template to {{status}} {{target}} - local_action: command {{gitdir}}/zone-template {{gitdir}}/fedoraproject.org.cfg {{status}} {{ansible_default_ipv4.address}} chdir={{gitdir}} + - name: Clone the dns repo into /var/tmp/dns-checkout..... + local_action: git repo=/git/dns/ dest={{tmp.stdout}} + + - name: Run zone-template + local_action: command {{tmp.stdout}}/zone-template {{tmp.stdout}}/fedoraproject.org.cfg {{status}} {{ansible_default_ipv4.address}} chdir={{tmp.stdout}} - name: Commit once - local_action: command git commit -a -m '{{status}} {{inventory_hostname}}' --author '{{userstring}}' chdir={{gitdir}} + local_action: command git commit -a -m '{{status}} {{inventory_hostname}}' --author '{{userstring}}' chdir={{tmp.stdout}} - name: Do domains - local_action: command {{gitdir}}/do-domains chdir={{gitdir}} + local_action: command {{tmp.stdout}}/do-domains chdir={{tmp.stdout}} - name: Commit second time - local_action: command git commit -a -m 'done build' --author '{{userstring}}' chdir={{gitdir}} + local_action: command git commit -a -m 'done build' --author '{{userstring}}' chdir={{tmp.stdout}} - name: Push our changes back - local_action: command git push chdir={{gitdir}} + local_action: command git push chdir={{tmp.stdout}} - - name: Destroy our temporary clone of /git/dns/ at {{gitdir}} - local_action: file dest={{gitdir}} state=absent + - 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