diff --git a/roles/isc-dhcp-server/handlers/main.yml b/roles/isc-dhcp-server/handlers/main.yml new file mode 100644 index 0000000..2df3eac --- /dev/null +++ b/roles/isc-dhcp-server/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart dhcpd + systemd: + state: restarted + name: isc-dhcp-server diff --git a/roles/isc-dhcp-server/tasks/main.yml b/roles/isc-dhcp-server/tasks/main.yml index 4d6ef54..13ba3b7 100644 --- a/roles/isc-dhcp-server/tasks/main.yml +++ b/roles/isc-dhcp-server/tasks/main.yml @@ -7,6 +7,7 @@ register: apt_result retries: 3 until: apt_result is succeeded + notify: restart dhcpd - name: Ensure dhcp log directory exists file: @@ -50,6 +51,7 @@ src: default/isc-dhcp-server.j2 dest: /etc/default/isc-dhcp-server mode: 0644 + notify: restart dhcpd - name: Configure dhcp-failover.conf template: @@ -57,9 +59,11 @@ dest: /etc/dhcp/dhcp-failover.conf mode: 0600 when: dhcp_failover is defined + notify: restart dhcpd - name: Configure dhcpd.conf template: src: dhcp/dhcpd.conf.j2 dest: /etc/dhcp/dhcpd.conf mode: 0600 + notify: restart dhcpd diff --git a/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 b/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 index bad8558..f4150e7 100644 --- a/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 +++ b/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 @@ -1,5 +1,3 @@ -# {{ ansible_managed }} - default-lease-time 86400; max-lease-time 86400;