ansible/roles/dhcpd/tasks/main.yml

30 lines
576 B
YAML
Raw Permalink Normal View History

---
- name: Install isc-dhcp-server
apt:
name: isc-dhcp-server
- name: Configure isc-dhcp-server
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: u=rw,g=r,o=
owner: root
group: root
loop:
- src: dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf
- src: default.j2
dest: /etc/default/isc-dhcp-server
notify:
- Restart isc-dhcp-server
#- src: dhcpd6.conf.j2
# dest: /etc/dhcp/dhcpd6.conf
- name: Enable and start isc-dhcp-server
systemd:
name: isc-dhcp-server.service
state: started
enabled: true
...