From 88c23c36931255f722cedf92ec7660ceb64a8968 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Fri, 7 Jul 2017 07:48:21 +0200 Subject: [PATCH] Clean up, specify eth0 as dhcp interface. --- roles/dhcpd/tasks/main.yml | 12 ++++-------- roles/dhcpd/templates/default/isc-dhcp-server | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 roles/dhcpd/templates/default/isc-dhcp-server diff --git a/roles/dhcpd/tasks/main.yml b/roles/dhcpd/tasks/main.yml index ba04908..b3554ea 100644 --- a/roles/dhcpd/tasks/main.yml +++ b/roles/dhcpd/tasks/main.yml @@ -1,18 +1,14 @@ --- - name: Install dhcp server - apt: name={{item}} state=latest - tags: dhcp - with_items: - - isc-dhcp-server + apt: name=isc-dhcp-server - name: Configure dhcp server - template: src={{item}}.j2 dest=/etc/{{item}} - tags: dhcp - notify: Restart isc-dhcp-server + template: src={{ item }}.j2 dest=/etc/{{ item }} with_items: + - default/isc-dhcp-server - dhcp/dhcpd.conf + notify: Restart isc-dhcp-server - name: Start the dhcp server service: name=isc-dhcp-server state=started enabled=yes - tags: dhcp diff --git a/roles/dhcpd/templates/default/isc-dhcp-server b/roles/dhcpd/templates/default/isc-dhcp-server new file mode 100644 index 0000000..e756ef3 --- /dev/null +++ b/roles/dhcpd/templates/default/isc-dhcp-server @@ -0,0 +1,17 @@ +# +# This is a POSIX shell fragment +# + +# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). +#DHCPD_CONF=/etc/dhcp/dhcpd.conf + +# Path to dhcpd's PID file (default: /var/run/dhcpd.pid). +#DHCPD_PID=/var/run/dhcpd.pid + +# Additional options to start dhcpd with. +# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead +#OPTIONS="" + +# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +INTERFACES="eth0"