From ce17d2d44c61b0784833b7b4bcf6a8296f4728cc Mon Sep 17 00:00:00 2001 From: Federico Palladoro Date: Thu, 22 Feb 2018 11:24:00 -0300 Subject: [PATCH] Add cache-size and log configs --- defaults/main.yml | 10 ++++++++++ templates/etc/dnsmasq.conf.j2 | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 7e905ae..4e8c6ac 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -99,6 +99,16 @@ dnsmasq_nameservers: - 8.8.4.4 - 8.8.8.8 +# Define size of the dns cache +# The default is 150 names +dnsmasq_cache_size: 150 + +# Defines if queries should be logged +dnsmasq_log_queries: false + +# Defines location of logfile +dnsmasq_log_facility: /var/log/dnsmasq.log + dnsmasq_pri_bind_address: "{{ ansible_default_ipv4['address'] }}" dnsmasq_pri_domain_name: 'example.org' diff --git a/templates/etc/dnsmasq.conf.j2 b/templates/etc/dnsmasq.conf.j2 index 0594f14..a507c81 100644 --- a/templates/etc/dnsmasq.conf.j2 +++ b/templates/etc/dnsmasq.conf.j2 @@ -34,6 +34,13 @@ domain={{ dnsmasq_pri_domain_name }} domain={{ item['domain'] }},{{ item['network']|join (',') }} {% endfor %} {% endif %} +{% if dnsmasq_cache_size is defined %} +cache-size={{ dnsmasq_cache_size }} +{% endif %} +{% if dnsmasq_log_queries %} +log-queries +log-facility={{ dnsmasq_log_facility }} +{% endif %} {% if dnsmasq_enable_forwarders %} {% for item in dnsmasq_nameservers %} server={{ item }}