unbound: fix dhclient.conf copy

The original version of this was wishful thinking: "is file" only
works locally, but this needs to run on the remote node.

Change-Id: Ib683809fdf580f41d213308331925c4765bb09d9
This commit is contained in:
James E. Blair 2018-08-28 14:28:48 -07:00
parent 70730c0fe3
commit c6b22d7e13
2 changed files with 13 additions and 6 deletions

View File

@ -0,0 +1,11 @@
- name: Register dhclient config file
stat:
path: "{{ item }}"
register: _dhclient
- name: Write dhclient config file
when: _dhclient.stat.exists | bool
copy:
src: dhclient.conf
dest: "{{ item }}"
mode: 0444

View File

@ -11,12 +11,8 @@
state: present
name: unbound
- name: Write dhclient config file
copy:
src: dhclient.conf
dest: "{{ item }}"
mode: 0444
when: item is file
- name: Write dhclient config files
include_tasks: dhclient.yaml
loop:
- /etc/dhcp/dhclient.conf
- /etc/dhcp/dhclient-eth0.conf