ansible/roles/dhcpd/tasks/main.yml

19 lines
377 B
YAML

---
- name: Install dhcp server
apt: name={{item}} state=latest
tags: dhcp
with_items:
- isc-dhcp-server
- name: Configure dhcp server
template: src={{item}}.j2 dest=/etc/{{item}}
tags: dhcp
notify: Restart isc-dhcp-server
with_items:
- dhcp/dhcpd.conf
- name: Start the dhcp server
service: name=isc-dhcp-server state=started enabled=yes
tags: dhcp