19 lines
906 B
Django/Jinja
19 lines
906 B
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
# Change dhcp-option to dhcp-option-force if you need PXELinux support
|
|
{% for item in mappings.list %}
|
|
{% if item.type=="<<tag>>" %}
|
|
dhcp-option={{ item.dhcp_option }}
|
|
{% elif item.type=="<<physical>>" or item.type=="<<virtual>>" %}
|
|
|
|
# {{ item.comment }}
|
|
address=/{{ item.hostname }}.{{ item.domainname }}/{{ item.ip_address }}
|
|
ptr-record={{ (item.ip_address.split('.'))[::-1]|join('.') }}.in-addr.arpa,{{ item.hostname }}.{{ item.domainname }}
|
|
dhcp-host={% if item.mac_address is defined and item.mac_address|length %}{{ item.mac_address }},{% endif %}{% if item.dhcp_option is defined and item.dhcp_option|length >0%}set:{{ item.dhcp_option }},{% endif %}{{ item.ip_address }},{{ item.hostname }}{% if item.static is defined and item.static|length%},ignore{% endif %}
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
# Include ansible managed static hosts
|
|
addn-hosts=/etc/pihole/ansible-managed.hosts
|