LASMagLab DHCPd with template instead of static file
One might want to use a template for the DHCPd server entry in the dhcpd.conf
, so that one does not have to change it for a new computer.
Hints/Ideas for the template:
- MAC address: ('ansible_interfaces' starts with 'enp') ['ansible_enp????']['macaddress'] when ['ansible_enp???']['ipv4']['network'] == '192.168.0.0'
- Hostname: ['ansible_fqdn']
- IP: '192.168.0.1'
# DHCPd host
host {{'ansible_hostname'}} {
hardware ethernet {{ macaddress }};
fixed-address {{ ip }};
}