From 3781383888030d38e5453976563c4df73bb4b2d2 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Mon, 19 Feb 2018 21:51:43 +0300 Subject: [PATCH] Use default nameservers which given by the provider instead of googles --- roles/dns_adblocking/templates/dnsmasq.conf.j2 | 2 +- roles/vpn/templates/ipsec.conf.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/dns_adblocking/templates/dnsmasq.conf.j2 b/roles/dns_adblocking/templates/dnsmasq.conf.j2 index 3424d544..03389778 100644 --- a/roles/dns_adblocking/templates/dnsmasq.conf.j2 +++ b/roles/dns_adblocking/templates/dnsmasq.conf.j2 @@ -88,7 +88,7 @@ # You can control how dnsmasq talks to a server: this forces # queries to 10.1.2.3 to be routed via eth1 # server=10.1.2.3@eth1 -{% for host in dns_servers.ipv4 %} +{% for host in ansible_dns['nameservers']|default(dns_servers['ipv4']) %} server={{ host }} {% endfor %} diff --git a/roles/vpn/templates/ipsec.conf.j2 b/roles/vpn/templates/ipsec.conf.j2 index 6c5a2d45..5b4615d8 100644 --- a/roles/vpn/templates/ipsec.conf.j2 +++ b/roles/vpn/templates/ipsec.conf.j2 @@ -31,7 +31,7 @@ conn %default {% if local_dns is defined and local_dns == "Y" %} rightdns={{ local_service_ip }} {% else %} - rightdns={% for host in dns_servers.ipv4 %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %}{% if ipv6_support is defined and ipv6_support == "yes" %},{% for host in dns_servers.ipv6 %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %} + rightdns={% for host in ansible_dns['nameservers']|default(dns_servers['ipv4']) %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %} {% endif %} conn ikev2-pubkey