dhcpd: Install and configure ISC DHCPD
This commit is contained in:
30
roles/dhcpd/tasks/main.yml
Normal file
30
roles/dhcpd/tasks/main.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
- name: ensure dhcpd is installed
|
||||
package:
|
||||
name=dhcp-server
|
||||
state=present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure dhcpd service is configured
|
||||
template:
|
||||
src=dhcpd.confd.j2
|
||||
dest=/etc/conf.d/dhcpd
|
||||
mode=0644
|
||||
when: ansible_distribution == 'Gentoo'
|
||||
notify: restart dhcpd
|
||||
- name: ensure dhcpd is configured
|
||||
template:
|
||||
src=dhcpd.conf.j2
|
||||
dest=/etc/dhcp/dhcpd.conf
|
||||
mode=0644
|
||||
notify: restart dhcpd
|
||||
|
||||
- name: ensure dhcpd starts at boot
|
||||
service:
|
||||
name=dhcpd
|
||||
enabled=yes
|
||||
- meta: flush_handlers
|
||||
- name: ensure dhcpd is running
|
||||
service:
|
||||
name=dhcpd
|
||||
state=started
|
||||
Reference in New Issue
Block a user