Add 'dhcpd_zones' list variable

This commit is contained in:
Maciej Delmanowski 2015-03-30 13:58:19 +02:00
parent 5014dd8642
commit 0e0d53bbc8
4 changed files with 55 additions and 1 deletions

View File

@ -164,6 +164,13 @@ dhcpd_options: False
dhcpd_keys: [] dhcpd_keys: []
# .. envvar:: dhcpd_zones
#
# List of DNS zones to update with Dynamic DNS configuration. See
# :ref:`dhcpd_zones` for more details.
dhcpd_zones: []
# .. envvar:: dhcpd_classes # .. envvar:: dhcpd_classes
# #
# List of client classes (see dhcpd.conf(5)). More informaction can be found in # List of client classes (see dhcpd.conf(5)). More informaction can be found in

View File

@ -43,6 +43,35 @@ Examples::
secret: "{{ dhcpd_secret_secure_key }}" secret: "{{ dhcpd_secret_secure_key }}"
.. _dhcpd_zones:
dhcpd_zones
-----------
This list lets you define DNS zones used to update dynamic DNS with information
configured using DHCP.
``zone``
DNS domain name of a zone, needs to end with a dot (``.``)
``primary``
Address of the primary DNS server serving the specified zone
``key``
Name of the symmetric key used to authorize Dynamic DNS updates of the
specified zone
``comment``
An optional comment added in the configuration file
Examples::
dhcpd_zones:
- zone: "example.org."
primary: "127.0.0.1"
key: "secure-key"
.. _dhcpd_classes: .. _dhcpd_classes:
dhcpd_classes dhcpd_classes

View File

@ -32,6 +32,11 @@ log-facility {{ dhcpd_log_facility }};
{{ print.key(key) }} {{ print.key(key) }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if dhcpd_zones is defined and dhcpd_zones %}
{% for zone in dhcpd_zones %}
{{ print.zone(zone) }}
{% endfor %}
{% endif %}
{% if dhcpd_classes is defined and dhcpd_classes %} {% if dhcpd_classes is defined and dhcpd_classes %}
{% for class in dhcpd_classes %} {% for class in dhcpd_classes %}
{{ print.class(class) }} {{ print.class(class) }}

View File

@ -211,8 +211,21 @@ failover peer "{{ failover.failover }}" {
{% if key.comment is defined and key.comment %} {% if key.comment is defined and key.comment %}
# {{ key.comment }} # {{ key.comment }}
{% endif %} {% endif %}
key "{{ key.key }}" { key {{ key.key }} {
algorithm {{ key.algorithm|default('hmac-md5') }}; algorithm {{ key.algorithm|default('hmac-md5') }};
secret {{ key.secret }}; secret {{ key.secret }};
} }
{% endmacro %} {% endmacro %}
{#
#
# ---- Macro: print.zone() ----
#}
{% macro zone(zone) %}
{% if zone.comment is defined and zone.comment %}
# {{ zone.comment }}
{% endif %}
zone {{ zone.zone }} {
primary {{ zone.primary }};
key {{ zone.key }};
}
{% endmacro %}