dhcpd: Initial version of role.

Currently works only for main DHCP server.
This commit is contained in:
Timo Makinen 2021-04-22 20:37:28 +00:00
parent 4634a9687b
commit d4a29bb758
5 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,24 @@
---
- name: include OS-specific variables
include_vars: "{{ ansible_os_family }}.yml"
- name: install packages
package:
name: "{{ dhcpd_package }}"
state: installed
- name: create config
template:
dest: "{{ dhcpd_config }}"
src: dhcpd.conf.j2
owner: root
group: "{{ ansible_wheel }}"
#validate: "dhcpd -t -cf %s"
notify: restart dhcpd
- name: enable service
service:
name: "{{ dhcpd_service }}"
state: started
enabled: true
arguments: "-user _isc-dhcp -group _isc-dhcp vio0"