From 2071508f1f618aa994ca3e66454c6c0d955dfedc Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Mon, 3 Apr 2017 22:35:54 +0200 Subject: [PATCH] Bind dhcpd to client bridge --- roles/dhcpd/defaults/main.yml | 1 + roles/dhcpd/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+) 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