From 2672e9009832d5890c2476dfe325ba69ab469ee6 Mon Sep 17 00:00:00 2001 From: Karl Goetz Date: Thu, 18 Jun 2020 11:38:47 +1000 Subject: [PATCH] Allow DNS server to be specified Squid can be configured with specific nameservers for DNS resolution. This change allows specifying the server for performance or security reasons. --- defaults/main.yml | 3 +++ templates/etc/squid/squid.conf.j2 | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 85ce495..7117979 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,9 @@ --- # defaults file for ansible-squid +# Example of DNS server to query +# squid_dns_nameservers: 127.0.0.1 + # squid auth parameters squid_auth_param: [] # - name: basic diff --git a/templates/etc/squid/squid.conf.j2 b/templates/etc/squid/squid.conf.j2 index d8767c8..a062067 100644 --- a/templates/etc/squid/squid.conf.j2 +++ b/templates/etc/squid/squid.conf.j2 @@ -1,5 +1,9 @@ {{ ansible_managed|comment }} +{% if squid_dns_nameservers is defined %} +dns_nameservers {{ squid_dns_nameservers }} +{% endif %} + {% if squid_auth_param is defined %} # AUTH_PARAM {% for item in squid_auth_param %}