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"