From 1d2d3d086dbbdc8d7387b6f71c0780d6df85ecb9 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotjagov Date: Mon, 26 Nov 2018 16:42:03 +0200 Subject: [PATCH] Adds ability to set no-resolv for dnsmasq. Introduces variable neutron_dnsmasq_noresolv. When it is set to true, no-resolv option will be placed in dnsmasq-neutron.conf. If dnsmasq_dns_servers are not set, and neutron_dnsmasq_noresolv is True dnsmasq will reply with empty response on DNS requests, which may be used as a workaround of https://bugs.launchpad.net/neutron/+bug/1501206 As a con, resolver is actually won't work at all, so all networks w/o configured DNS will stop resolving DNS. Change-Id: I7764e0d6100a8327f84f78da64f10f8e1fa355b1 --- defaults/main.yml | 6 ++++++ templates/dnsmasq-neutron.conf.j2 | 3 +++ 2 files changed, 9 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 43ba78d9..2da086ad 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -132,6 +132,12 @@ neutron_dns_domain: "openstacklocal." neutron_dhcp_config: log-facility: "{{ neutron_log_dir }}/neutron-dnsmasq.log" +# Disable dnsmasq to resolve DNS via local resolv.conf. +# When dnsmasq_dns_servers are not set, +# and neutron_dnsmasq_noresolv is set to True, dnsmasq will reply with +# empty respose on DNS requests. +neutron_dnsmasq_noresolv: False + # Set the neutron lbaasv2 user group, defaults from os specific vars neutron_lbaasv2_user_group: "{{ _neutron_lbaasv2_user_group }}" diff --git a/templates/dnsmasq-neutron.conf.j2 b/templates/dnsmasq-neutron.conf.j2 index ebd1d620..15263dac 100644 --- a/templates/dnsmasq-neutron.conf.j2 +++ b/templates/dnsmasq-neutron.conf.j2 @@ -4,3 +4,6 @@ {{ key }}={{ value }} {% endfor %} user={{ neutron_system_user_name }} +{% if neutron_dnsmasq_noresolv %} +no-resolv +{% endif %} \ No newline at end of file