You've already forked role_dnsmasq
feat: Create role
This commit is contained in:
50
templates/dnsmasq.conf.j2
Normal file
50
templates/dnsmasq.conf.j2
Normal file
@@ -0,0 +1,50 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# Listen only on the specified interface(s)
|
||||
interface={{ dnsmasq_interface }}
|
||||
|
||||
# Tells dnsmasq to never forward A or AAAA queries for plain names
|
||||
domain-needed
|
||||
|
||||
# Specifies DNS domains
|
||||
domain={{ dnsmasq_domain }}
|
||||
local=/{{ dnsmasq_domain }}/
|
||||
|
||||
# Add the domain to simple names
|
||||
expand-hosts
|
||||
|
||||
# Disable negative caching
|
||||
no-negcache
|
||||
|
||||
# Don't read /etc/resolv.conf
|
||||
no-resolv
|
||||
|
||||
# Don't read the hostnames in /etc/hosts
|
||||
no-hosts
|
||||
|
||||
# Specify upstream servers directly
|
||||
{% for server in dnsmasq_servers %}
|
||||
server={{ server }}
|
||||
{% endfor %}
|
||||
|
||||
# Specify upstream servers directly (PTR)
|
||||
{% for server in dnsmasq_rev_servers %}
|
||||
rev-server={{ server }}
|
||||
{% endfor %}
|
||||
|
||||
# Do not detect and block dns-rebind on queries to these domains
|
||||
{% for domain in dnsmasq_rebind_domains %}
|
||||
rebind-domain-ok=/{{ domain }}/
|
||||
{% endfor %}
|
||||
|
||||
# Reject (and log) addresses from upstream nameservers which are in the private ranges
|
||||
stop-dns-rebind
|
||||
|
||||
# Exempt 127.0.0.0/8 and ::1 from rebinding checks
|
||||
rebind-localhost-ok
|
||||
|
||||
# Set the size of dnsmasq's cache
|
||||
cache-size=4096
|
||||
|
||||
# Additional hosts file. Read the specified file as well as /etc/hosts
|
||||
addn-hosts={{ dnsmasq_records_directory }}
|
12
templates/records_auto.conf.j2
Normal file
12
templates/records_auto.conf.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{%- for host in groups[dnsmasq_ansible_group] | sort %}
|
||||
{%- set ipv4 = hostvars[host]['ansible_host'] %}
|
||||
{%- set ipv6_prefix = dnsmasq_ipv6_subnet | split('/') | first %}
|
||||
{%- set ipv6_suffix = hostvars[host]['ansible_host'] | split('.') | last %}
|
||||
{%- set aliases = [host] + hostvars[host].get('dnsmasq_host_aliases', []) %}
|
||||
|
||||
## {{ host }}
|
||||
{{ ipv4 }} {{ aliases | join(' ') }}
|
||||
{{ ipv6_prefix }}{{ ipv6_suffix }} {{ aliases | join(' ') }}
|
||||
{% endfor %}
|
10
templates/records_specific.conf.j2
Normal file
10
templates/records_specific.conf.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{%- for specific in dnsmasq_specifics %}
|
||||
{%- set aliases = specific.aliases | default([]) %}
|
||||
|
||||
## {{ specific.hostname }}
|
||||
{% for ip in specific.ips %}
|
||||
{{ ip }} {{ ([specific.hostname] + aliases) | join(' ') }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
4
templates/stub-listener.conf.j2
Normal file
4
templates/stub-listener.conf.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Resolve]
|
||||
DNSStubListener=no
|
Reference in New Issue
Block a user