Merge pull request #6 from drybjed/create-dhcpd-includes

Make sure that included files exist before restart
This commit is contained in:
Maciej Delmanowski 2015-04-07 13:09:16 +02:00
commit 5e25f66fd1
2 changed files with 21 additions and 0 deletions

View File

@ -1,6 +1,14 @@
Changelog
=========
v0.1.1
------
*Unreleased*
- Make sure that files specified in ``dhcpd_includes`` list exist before the
DHCP server is restarted. [drybjed]
v0.1.0
------

View File

@ -47,8 +47,21 @@
mode: '0644'
with_items: [ 'etc/default/isc-dhcp-server', 'etc/dhcp/dhcpd.conf' ]
notify: [ 'Restart isc-dhcp-server' ]
register: dhcpd_register_config
when: dhcpd_mode == 'server'
- name: Make sure that included files exist
file:
path: '{{ item }}'
state: 'touch'
owner: 'root'
group: 'root'
mode: '0644'
with_items: dhcpd_includes
notify: [ 'Restart isc-dhcp-server' ]
when: ((item is defined and item) and dhcpd_mode == 'server' and
(dhcpd_register_config is defined and dhcpd_register_config.changed))
- name: Make sure that IPv6 lease file exists
command: touch /var/lib/dhcp/dhcpd6.leases creates=/var/lib/dhcp/dhcpd6.leases
when: dhcpd_ipversion == '6'