Added role misc/dnsmasq as dnssec resolver
parent
fbf20622b0
commit
e09fb25104
@ -1 +1,5 @@
|
||||
---
|
||||
|
||||
global_dns_upstream_servers:
|
||||
- 213.136.95.10
|
||||
- 213.136.95.11
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
listen_address: "127.0.0.53" # Needs to be an address of the loopback device
|
||||
|
||||
cache_size: 10000
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: restart dnsmasq
|
||||
systemd:
|
||||
state: restarted
|
||||
name: dnsmasq.service
|
||||
enabled: yes
|
@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Install required packages
|
||||
apt:
|
||||
state: present
|
||||
name:
|
||||
- dnsmasq
|
||||
|
||||
- name: Configure dnsmasq
|
||||
template:
|
||||
src: dnsmasq.conf
|
||||
dest: "{{ global_dnsmasq_configuration_directory }}/0_main.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rw,g=r,o=r
|
||||
validate: "/usr/sbin/dnsmasq --test --conf-file=%s"
|
||||
notify: restart dnsmasq
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: Configure system to use dnsmasq
|
||||
template:
|
||||
src: resolv.conf
|
||||
dest: "{{ global_resolv_conf }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=r,g=r,o=r
|
||||
attributes: +i # immutable, may will let this task failing
|
@ -0,0 +1,18 @@
|
||||
# Bind only on loopback interface
|
||||
bind-interfaces
|
||||
interface=lo
|
||||
listen-address={{ listen_address }}
|
||||
# Supress resolv.conf
|
||||
no-resolv
|
||||
no-poll
|
||||
# Upstream dns servers
|
||||
{% for ip in global_dns_upstream_servers %}
|
||||
server={{ ip }}
|
||||
{% endfor %}
|
||||
# Enable caching
|
||||
cache-size={{ cache_size }}
|
||||
# Require full domains to be forwarded
|
||||
domain-needed
|
||||
# Verify dnssec values
|
||||
dnssec
|
||||
dnssec-check-unsigned
|
@ -0,0 +1,2 @@
|
||||
# resolv.conf generated by Ansible to local dnsmasq
|
||||
nameserver {{ listen_address }}
|
Loading…
Reference in New Issue