ansible-dhcpd/templates/etc/dhcp/dhcpd.conf.j2

89 lines
2.4 KiB
Plaintext
Raw Normal View History

2015-03-29 19:24:30 +00:00
{% import 'macros.j2' as print with context %}
# {{ ansible_managed }}
2014-11-28 09:54:28 +00:00
{% if dhcpd_authoritative is defined and dhcpd_authoritative %}
authoritative;
{% elif dhcpd_authoritative is undefined or (dhcpd_authoritative is defined and not dhcpd_authoritative) %}
not authoritative;
{% endif %}
{% if dhcpd_global_default_lease_time|d() and dhcpd_global_default_lease_time %}
default-lease-time {{ dhcpd_global_default_lease_time }};
{% endif %}
{% if dhcpd_global_max_lease_time|d() and dhcpd_global_max_lease_time %}
max-lease-time {{ dhcpd_global_max_lease_time }};
{% endif %}
{% if dhcpd_log_facility|d() and dhcpd_log_facility %}
log-facility {{ dhcpd_log_facility }};
{% endif %}
{% if dhcpd_auto_options|d() and dhcpd_auto_options %}
{% include 'auto_options.j2' %}
{% endif %}
{% if dhcpd_options is defined and dhcpd_options %}
# Configuration options
{{ dhcpd_options }}
2014-12-18 13:10:12 +00:00
{% endif %}
{% if dhcpd_keys is defined and dhcpd_keys %}
{% for key in dhcpd_keys %}
2015-03-29 19:24:30 +00:00
{{ print.key(key) }}
2014-12-18 13:10:12 +00:00
{% endfor %}
{% endif %}
{% if dhcpd_classes is defined and dhcpd_classes %}
{% for class in dhcpd_classes %}
2015-03-29 19:24:30 +00:00
{{ print.class(class) }}
{% endfor %}
{% endif %}
2014-11-28 09:54:28 +00:00
{% if dhcpd_failovers is defined and dhcpd_failovers %}
{% for failover in dhcpd_failovers %}
2015-03-29 19:24:30 +00:00
{{ print.failover(failover) }}
2014-11-28 09:54:28 +00:00
{% endfor %}
{% endif %}
{% if dhcpd_shared_networks is defined and dhcpd_shared_networks %}
{% for network in dhcpd_shared_networks %}
{% if network.subnets is defined and network.subnets %}
{% if network.comment is defined and network.comment %}
# {{ network.comment }}
{% endif %}
shared-network "{{ network.name }}" {
{% if network.options is defined and network.options %}
{{ network.options | indent(8,true) }}
{% endif %}
{% if network.include is defined and network.include %}
include "{{ network.include }}";
{% endif %}
{% for subnet in network.subnets %}
2015-03-29 19:24:30 +00:00
{{ print.subnet(subnet) | indent(8,true) }}
{% endfor %}
}
{% endif %}
{% endfor %}
{% endif %}
{% if dhcpd_groups is defined and dhcpd_groups %}
{% for group in dhcpd_groups %}
2015-03-29 19:24:30 +00:00
{{ print.group(group) }}
{% endfor %}
{% endif %}
{% if dhcpd_subnets is defined and dhcpd_subnets %}
{% for subnet in dhcpd_subnets %}
2015-03-29 19:24:30 +00:00
{{ print.subnet(subnet) }}
{% endfor %}
{% endif %}
{% if dhcpd_hosts is defined and dhcpd_hosts %}
2015-03-29 19:24:30 +00:00
{{ print.hosts(dhcpd_hosts) }}
{% endif %}
{% if dhcpd_includes is defined and dhcpd_includes %}
{% for include in dhcpd_includes %}
include "{{ include }}";
{% endfor %}
{% endif %}
{#
vim: ft=dhcpd
#}