diff --git a/roles/dhcpd/defaults/main.yml b/roles/dhcpd/defaults/main.yml index ed7484c..9c96c1a 100644 --- a/roles/dhcpd/defaults/main.yml +++ b/roles/dhcpd/defaults/main.yml @@ -1,5 +1,6 @@ --- +dhcpd_interfaces: br-{{ site_code }} dhcpd_mtu: 1280 dhcpd_first: "{{ batman_ipv4 | ipaddr('512') | ipaddr('address') }}" dhcpd_last: "{{ batman_ipv4 | ipaddr('2558') | ipaddr('address') }}" diff --git a/roles/dhcpd/tasks/main.yml b/roles/dhcpd/tasks/main.yml index e3d6d5d..507658b 100644 --- a/roles/dhcpd/tasks/main.yml +++ b/roles/dhcpd/tasks/main.yml @@ -7,5 +7,12 @@ template: src=dhcpd.conf.j2 dest=/etc/dhcp/dhcpd.conf notify: Restart isc-dhcp-server +- name: Specify dhcp interfaces + lineinfile: + dest: /etc/default/isc-dhcp-server + line: "INTERFACES=\"{{ dhcpd_interfaces }}\"" + regexp: "^INTERFACES=" + notify: Restart isc-dhcp-server + - name: Start the dhcp server service: name=isc-dhcp-server state=started enabled=yes