zen_dhcpd/tasks/main.yml
Chris Hammer c9797f1508 0.1.22-DEV-20220828-202411
--------------------------
    * ADD:
      - add support for centos 8+

    * MODIFY:
      - modify dns for vlan1
2022-08-28 20:25:05 -04:00

40 lines
715 B
YAML

---
# tasks file for zen_dhcpd
- name: install dhcpd package
yum:
name: dhcp
state: present
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version < "8"
- name: install dhcp-server package
dnf:
name: dhcp-server
state: present
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version >= "8"
- name: deploy dhcpd config
template:
src: templates/dhcpd_conf.j2
dest: "/etc/dhcp/dhcpd.conf"
mode: 0644
notify: restart dhcpd
- name: enable/start dhcpd
service:
name: dhcpd
enabled: yes
state: started
when:
- ansible_distribution == "CentOS"
- ansible_virtualization_type != "docker"
...