dhcp: restart server on config update

This commit is contained in:
Yohaï-Eliel BERREBY 2020-05-08 16:44:08 +02:00
parent 223578eefa
commit a4d0f051b6
3 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,4 @@
- name: restart dhcpd
systemd:
state: restarted
name: isc-dhcp-server

View file

@ -7,6 +7,7 @@
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
notify: restart dhcpd
- name: Ensure dhcp log directory exists - name: Ensure dhcp log directory exists
file: file:
@ -50,6 +51,7 @@
src: default/isc-dhcp-server.j2 src: default/isc-dhcp-server.j2
dest: /etc/default/isc-dhcp-server dest: /etc/default/isc-dhcp-server
mode: 0644 mode: 0644
notify: restart dhcpd
- name: Configure dhcp-failover.conf - name: Configure dhcp-failover.conf
template: template:
@ -57,9 +59,11 @@
dest: /etc/dhcp/dhcp-failover.conf dest: /etc/dhcp/dhcp-failover.conf
mode: 0600 mode: 0600
when: dhcp_failover is defined when: dhcp_failover is defined
notify: restart dhcpd
- name: Configure dhcpd.conf - name: Configure dhcpd.conf
template: template:
src: dhcp/dhcpd.conf.j2 src: dhcp/dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf dest: /etc/dhcp/dhcpd.conf
mode: 0600 mode: 0600
notify: restart dhcpd

View file

@ -1,5 +1,3 @@
# {{ ansible_managed }}
default-lease-time 86400; default-lease-time 86400;
max-lease-time 86400; max-lease-time 86400;