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.
jenkins-master
Dustin 2018-05-06 13:38:15 -05:00
parent 40e9573f57
commit efc78f0db6
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ subnet {{ subnet.address|ipv4('network') }} netmask {{ subnet.address|ipv4('netm
filename "{{ subnet.boot_filename }}"; filename "{{ subnet.boot_filename }}";
{% endif %} {% endif %}
{% 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)) }}; 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)) }}; ddns-hostname = {{ dyn_hostname_expr.format(prefix=subnet.dyn_hostname_prefix|d(default_dyn_hostname_prefix)) }};
{% endif %} {% endif %}