Infra/ansible/roles/pi_dnsmasq/templates/02-custom.conf.j2

19 lines
563 B
Django/Jinja

{{ ansible_managed | comment }}
# http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
addn-hosts=/etc/hosts.custom
{% for alias in dnsmasq.aliases %}
address=/{{ alias.host }}/{{ alias.ip }}
{% endfor %}
{% for server in dnsmasq.servers %}
{% if server.reverse|default(False) %}
rev-server={{ server.mask }},{{ server.gateway }}
{% endif %}
{% if server.lookup|default(False) %}
server=/{{ (server.gateway.split("."))[:3] | reverse | join(".") }}.in-addr.arpa/{{ server.gateway }}
{% endif %}
server=/{{ server.host }}/{{ server.gateway }}
{% endfor %}