--- /dev/null
+- name: Install isc-dhcpd
+ community.general.pkgng:
+ name: isc-dhcp44-server
+ state: present
+ become: true
+- name: install dhcpd.conf
+ template:
+ src: dhcpd-{{ hostname }}.conf
+ dest: /usr/local/etc/dhcpd.conf
+ owner: root
+ group: wheel
+ mode: 0644
+ become: true
+- name: dhcpd enable
+ community.general.sysrc:
+ name: dhcpd_enable
+ value: "YES"
+- name: dhcpd flags
+ community.general.sysrc:
+ name: dhcpd_flags
+ value: "-q"
+- name: dhcpd conf
+ community.general.sysrc:
+ name: dhcpd_conf
+ value: "/usr/local/etc/dhcpd.conf"
+- name: dhcpd ifaces
+ community.general.sysrc:
+ name: dhcpd_ifaces
+ value: "igb1"
+- name: Start dhcpd
+ ansible.builtin.service:
+ name: isc-dhcpd
+ state: started
+ become: true
--- /dev/null
+# dhcpd.conf
+#
+
+# option definitions common to all supported networks...
+option domain-name "saturn.sigsegv.be";
+option domain-name-servers 10.0.1.1;
+
+option custom-lan-0 code 43 = string;
+
+default-lease-time 6000;
+max-lease-time 7200;
+
+# Use this to enble / disable dynamic dns updates globally.
+#ddns-update-style none;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+authoritative;
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
+# No service will be given on this subnet, but declaring it helps the
+# DHCP server to understand the network topology.
+
+subnet 10.0.1.0 netmask 255.255.255.0 {
+ range 10.0.1.10 10.0.1.200;
+ option routers 10.0.1.1;
+ option custom-lan-0 01:04:AC:10:03:04;
+}
+
+host unifi {
+ hardware ethernet b4:fb:e4:e4:4b:31;
+ fixed-address 10.0.1.3;
+}
+host plc {
+ hardware ethernet 00:0e:8c:f8:10:fa;
+ fixed-address 10.0.1.6;
+}
+host printer {
+ hardware ethernet 08:00:37:41:22:da;
+ fixed-address 10.0.1.7;
+}
+host walter-pc {
+ hardware ethernet f8:b1:56:cc:35:72;
+ fixed-address 10.0.1.70;
+}
+host laptop-walter {
+ hardware ethernet 00:0f:1f:b5:07:cd;
+ fixed-address 10.0.1.100;
+}
+host tuttle-wire {
+ hardware ethernet 00:25:64:74:e8:ef;
+ fixed-address 10.0.1.102;
+}
+host tuttle {
+ hardware ethernet 00:24:d6:75:74:90;
+ fixed-address 10.0.1.103;
+}