From 2d53620286fb139ffe7e292907c1935a29d20c02 Mon Sep 17 00:00:00 2001 From: Marcus Klein Date: Thu, 17 Nov 2022 12:11:48 +0100 Subject: [PATCH] Allow to set dnsmasq configuration options This is useful to work around https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1974230 by setting "no-negcache" into neutron_dhcp_config_list. Change-Id: I1a0c1b5a125c72635efc89c9763aa41bfb503a3f --- defaults/main.yml | 5 +++++ .../notes/neutron-dhcp-config-list-3e9354e5da138b53.yaml | 7 +++++++ templates/dnsmasq-neutron.conf.j2 | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/neutron-dhcp-config-list-3e9354e5da138b53.yaml diff --git a/defaults/main.yml b/defaults/main.yml index e754e055..41a103d9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -121,6 +121,11 @@ neutron_dns_domain: "{{ dhcp_domain | default('openstacklocal.') }}" # dhcp-option-force: "26,1500" neutron_dhcp_config: {} +# Dnsmasq has furthermore some options in its configuration that are not +# key/value pairs but just options. A deployer can configure those with this +# list: +neutron_dhcp_config_list: [] + # 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 diff --git a/releasenotes/notes/neutron-dhcp-config-list-3e9354e5da138b53.yaml b/releasenotes/notes/neutron-dhcp-config-list-3e9354e5da138b53.yaml new file mode 100644 index 00000000..bcce4514 --- /dev/null +++ b/releasenotes/notes/neutron-dhcp-config-list-3e9354e5da138b53.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + You can configure options for dnsmasq by adding those to the newly + introduced ``neutron_dhcp_config_list`` list. This helps to configure e.g. + ``no-negcache`` to get around + https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1974230. diff --git a/templates/dnsmasq-neutron.conf.j2 b/templates/dnsmasq-neutron.conf.j2 index 15263dac..8d7db032 100644 --- a/templates/dnsmasq-neutron.conf.j2 +++ b/templates/dnsmasq-neutron.conf.j2 @@ -3,6 +3,9 @@ {% for key, value in neutron_dhcp_config.items() %} {{ key }}={{ value }} {% endfor %} +{% for option in neutron_dhcp_config_list %} +{{ option }} +{% endfor %} user={{ neutron_system_user_name }} {% if neutron_dnsmasq_noresolv %} no-resolv