From a9d3b7894e2e4fc1a9f3be0d30d63ccc3b042c33 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 22 Mar 2019 09:05:14 -0500 Subject: [PATCH] roles/dhcpd: Support UniFi DHCP option 43 The `ubnt.unifi-address` DHCP option can be set to provide Ubiquiti hardware with the hostname of the UniFi controller. --- roles/dhcpd/templates/dhcpd.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/dhcpd/templates/dhcpd.conf.j2 b/roles/dhcpd/templates/dhcpd.conf.j2 index ab46ea8..fe27c66 100644 --- a/roles/dhcpd/templates/dhcpd.conf.j2 +++ b/roles/dhcpd/templates/dhcpd.conf.j2 @@ -1,6 +1,9 @@ # vim: set ft=dhcpd : {# vim: set ft=jinja : #} +option space ubnt; +option ubnt.unifi-address code 1 = ip-address; + {% if dhcp_domain_name is defined %} option domain-name "{{ dhcp_domain_name }}"; {% endif %} @@ -50,6 +53,9 @@ subnet {{ subnet.address|ipv4('network') }} netmask {{ subnet.address|ipv4('netm filename "{{ subnet.boot_filename }}"; {% endif %} {% endif %} +{% if subnet.unifi_address is defined %} + option ubnt.unifi-address {{ subnet.unifi_address }}; +{% endif %} {% if not subnet.ddns_updates|d(true)|bool %} ddns-updates off; {% elif subnet.dynamic_hostnames|d|bool %}