From efc78f0db66d3851ab1db4e24011b9e596990165 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 6 May 2018 13:38:15 -0500 Subject: [PATCH] roles/dhcpd: Allow disabling DDNS per-subnet In some cases, DDNS may be enabled globally, but some subnets may not utilize it. To support this scenario, subnets can set `ddns_updates` to false. --- roles/dhcpd/templates/dhcpd.conf.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/dhcpd/templates/dhcpd.conf.j2 b/roles/dhcpd/templates/dhcpd.conf.j2 index 1b57821..ab46ea8 100644 --- a/roles/dhcpd/templates/dhcpd.conf.j2 +++ b/roles/dhcpd/templates/dhcpd.conf.j2 @@ -50,7 +50,9 @@ subnet {{ subnet.address|ipv4('network') }} netmask {{ subnet.address|ipv4('netm filename "{{ subnet.boot_filename }}"; {% endif %} {% endif %} -{% if subnet.dynamic_hostnames|d|bool %} +{% if not subnet.ddns_updates|d(true)|bool %} + ddns-updates off; +{% elif subnet.dynamic_hostnames|d|bool %} option host-name = {{ dyn_hostname_expr.format(prefix=subnet.dyn_hostname_prefix|d(default_dyn_hostname_prefix)) }}; ddns-hostname = {{ dyn_hostname_expr.format(prefix=subnet.dyn_hostname_prefix|d(default_dyn_hostname_prefix)) }}; {% endif %}