123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- ## dhcpd.conf
- {% if dhcp_use_ansible_managed %}# {{ ansible_managed }}{% endif %}
- # Do not edit manually
- {% if dhcp_omapi_port is defined %}
- omapi-port {{ dhcp_omapi_port }};
- {% endif %}
- # option definitions common to all supported networks...
- {% if dhcp_common_domain is defined %}
- option domain-name "{{ dhcp_common_domain }}";
- {% endif %}
- {% if dhcp_common_nameservers is defined %}
- option domain-name-servers {{ dhcp_common_nameservers }};
- {% endif %}
- {% if dhcp_common_default_lease_time is defined %}
- default-lease-time {{ dhcp_common_default_lease_time }};
- {% endif %}
- {% if dhcp_common_max_lease_time is defined %}
- max-lease-time {{ dhcp_common_max_lease_time }};
- {% endif %}
- # Dynamic DNS
- ddns-updates {{ dhcp_ddns_updates | ternary("on", "off") }};
- ddns-update-style {{ dhcp_ddns_update_style }};
- {{ dhcp_ddns_client_updates | ternary("allow", "ignore") }} client-updates;
- {{ dhcp_ddns_unknown_clients | ternary("allow", "ignore") }} unknown-clients;
- update-static-leases {{ dhcp_ddns_update_static_leases | ternary("on", "off") }};
- {% if dhcp_ddns_keys is defined %}
- {% for key in dhcp_ddns_keys %}
- key {{ key.name }} {
- algorithm hmac-md5;
- secret {{ key.value }};
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_ddns_zones is defined %}
- {% for zone in dhcp_ddns_zones %}
- zone {{ zone.name }}. {
- primary {{ zone.primary }};
- key {{ zone.key }};
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_common_authoritative is defined %}
- # If this DHCP server is the official DHCP server for the local
- # network, the authoritative directive should be uncommented.
- authoritative;
- {% endif %}
- {% if dhcp_common_log_facility is defined %}
- # Use this to send dhcp log messages to a different log file (you also
- # have to hack syslog.conf to complete the redirection).
- log-facility {{ dhcp_common_log_facility }};
- {% endif %}
- {% if dhcp_common_options is defined %}
- {% if dhcp_common_enable_pxe_boot %}
- filename "{{ dhcp_common_pxe_boot_file }}";
- next-server {{ dhcp_common_pxe_boot_server }};
- {% endif %}
- #DHCP options
- {% for o in dhcp_common_options %}
- option {{ o }};
- {% endfor %}
- {% endif %}
- {% if dhcp_common_parameters is defined %}
- #DHCP parameters
- {% for p in dhcp_common_parameters %}
- {{ p }};
- {% endfor %}
- {% endif %}
- {% if dhcp_classes is defined %}
- # Classes
- {% for c in dhcp_classes %}
- class "{{ c.name }}" {
- {{ c.rule }};
- {% if c.options is defined %}
- {% for i in c.options %}
- option {{ i.opt }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_hosts is defined %}
- # Hosts
- {% for h in dhcp_hosts %}
- host {{ h.name }} {
- hardware ethernet {{ h.mac_address }};
- ddns-hostname {{ h.name }};
- {% if h.fixed_address is defined %}
- fixed-address {{ h.fixed_address }};
- {% endif %}
- {% if h.routers is defined %}
- option routers {{ h.routers }};
- {% endif %}
- {% if h.broadcast_address is defined %}
- option broadcast-address {{ h.broadcast_address }};
- {% endif %}
- {% if h.domain_nameservers is defined %}
- option domain-name-servers {{ h.domain_nameservers }};
- {% endif %}
- {% if h.domain_name is defined %}
- option domain-name "{{ h.domain_name }}";
- {% endif %}
- {% if h.default_lease_time is defined %}
- default-lease-time {{ h.default_lease_time }};
- {% endif %}
- {% if h.max_lease_time is defined %}
- max-lease-time {{ h.max_lease_time }};
- {% endif %}
- {% if h.parameters is defined %}
- {% for p in h.parameters %}
- {{ p }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_subnets is defined %}
- # Subnets
- {% for s in dhcp_subnets %}
- subnet {{ s.base }} netmask {{ s.netmask }} {
- {% if s.interface is defined %}
- interface "{{ s.interface }}";
- {% endif %}
- {% if s.range_start is defined %}
- range {{ s.range_start }} {{ s.range_end }};
- {% endif %}
- {% if s.routers is defined %}
- option routers {{ s.routers }};
- {% endif %}
- {% if s.broadcast_address is defined %}
- option broadcast-address {{ s.broadcast_address }};
- {% endif %}
- {% if s.domain_nameservers is defined %}
- option domain-name-servers {{ s.domain_nameservers }};
- {% endif %}
- {% if s.domain_name is defined %}
- option domain-name "{{ s.domain_name }}";
- {% endif %}
- {% if s.ntp_servers is defined %}
- option ntp-servers {{ s.ntp_servers }};
- {% endif %}
- {% if s.default_lease_time is defined %}
- default-lease-time {{ s.default_lease_time }};
- {% endif %}
- {% if s.max_lease_time is defined %}
- max-lease-time {{ s.max_lease_time }};
- {% endif %}
- {% if s.pools is defined %}
- {% for p in s.pools %}
- pool {
- {% if p.rule is defined %}
- {{ p.rule }};
- {% endif %}
- range {{ p.range_start }} {{ p.range_end }};
- {% if p.parameters is defined %}
- {% for param in p.parameters %}
- {{ param }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if s.parameters is defined %}
- {% for p in s.parameters %}
- {{ p }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_shared_networks is defined %}
- # Shared networks
- {% for n in dhcp_shared_networks %}
- shared-network {{ n.name }} {
- {% if n.interface is defined %}
- interface "{{ n.interface }}";
- {% endif %}
- {% for s in n.subnets %}
- subnet {{ s.base }} netmask {{ s.netmask }} {
- {% if s.range_start is defined %}
- range {{ s.range_start }} {{ s.range_end }};
- {% endif %}
- {% if s.routers is defined %}
- option routers {{ s.routers }};
- {% endif %}
- {% if s.broadcast_address is defined %}
- option broadcast-address {{ s.broadcast_address }};
- {% endif %}
- {% if s.domain_nameservers is defined %}
- option domain-name-servers {{ s.domain_nameservers }};
- {% endif %}
- {% if s.domain_name is defined %}
- option domain-name "{{ s.domain_name }}";
- {% endif %}
- {% if s.ntp_servers is defined %}
- option ntp-servers {{ s.ntp_servers }};
- {% endif %}
- {% if s.default_lease_time is defined %}
- default-lease-time {{ s.default_lease_time }};
- {% endif %}
- {% if s.max_lease_time is defined %}
- max-lease-time {{ s.max_lease_time }};
- {% endif %}
- {% if s.pools is defined %}
- {% for p in s.pools %}
- pool {
- {% if p.rule is defined %}
- {{ p.rule }};
- {% endif %}
- range {{ p.range_start }} {{ p.range_end }};
- {% if p.parameters is defined %}
- {% for param in p.parameters %}
- {{ param }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if s.parameters is defined %}
- {% for param in s.parameters %}
- {{ param }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% if n.pools is defined %}
- {% for p in n.pools %}
- pool {
- {{ p.rule }};
- range {{ p.range_start }} {{ p.range_end }};
- {% if p.parameters is defined %}
- {% for param in p.parameters %}
- {{ param }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if n.parameters is defined %}
- {% for p in n.parameters %}
- {{ p }};
- {% endfor %}
- {% endif %}
- }
- {% endfor %}
- {% endif %}
- {% if dhcp_ifelse is defined %}
- # If else clauses
- {% for ie in dhcp_ifelse %}
- if {{ ie.condition }} {
- {{ ie.val }}
- }{% if ie.else is defined %}{% for e in ie.else %} else {
- {{ e.val }}
- }{% endfor %}
- {% endif %}
- {% endfor %}
- {% endif %}
|