diff --git a/manifests/agents/dhcp.pp b/manifests/agents/dhcp.pp index 0f5f26f1e..b226f021e 100644 --- a/manifests/agents/dhcp.pp +++ b/manifests/agents/dhcp.pp @@ -42,8 +42,13 @@ # Defaults to $::os_service_default # # [*dnsmasq_dns_servers*] -# (optional) List of servers to use as dnsmasq forwarders. -# Defaults to $::os_service_default. +# (optional) List of servers to use as dnsmasq forwarders. +# Defaults to $::os_service_default. +# +# [*dnsmasq_local_resolv*] +# (optional) Enables the dnsmasq service to provide name resolution for instances +# via DNS resolvers on the host running the DHCP agent. +# Defaults to $::os_service_default. # # [*enable_isolated_metadata*] # (optional) enable metadata support on isolated networks. @@ -96,6 +101,7 @@ class neutron::agents::dhcp ( $root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf', $dnsmasq_config_file = $::os_service_default, $dnsmasq_dns_servers = $::os_service_default, + $dnsmasq_local_resolv = $::os_service_default, $enable_isolated_metadata = false, $enable_force_metadata = $::os_service_default, $enable_metadata_network = false, @@ -138,6 +144,7 @@ class neutron::agents::dhcp ( 'DEFAULT/dhcp_broadcast_reply': value => $dhcp_broadcast_reply; 'DEFAULT/dnsmasq_config_file': value => $dnsmasq_config_file; 'DEFAULT/dnsmasq_dns_servers': value => join(any2array($dnsmasq_dns_servers), ','); + 'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv; 'DEFAULT/ovs_integration_bridge': value => $ovs_integration_bridge; 'AGENT/availability_zone': value => $availability_zone; } diff --git a/releasenotes/notes/add_dnsmasq_local_resolv-options-19786234a35ef239.yaml b/releasenotes/notes/add_dnsmasq_local_resolv-options-19786234a35ef239.yaml new file mode 100644 index 000000000..fddee61e8 --- /dev/null +++ b/releasenotes/notes/add_dnsmasq_local_resolv-options-19786234a35ef239.yaml @@ -0,0 +1,5 @@ +--- +features: + - Add 'dnsmasq_local_resolv' option support to Enables the dnsmasq + service to provide name resolution for instances via DNS resolvers + on the host running the DHCP agent. diff --git a/spec/classes/neutron_agents_dhcp_spec.rb b/spec/classes/neutron_agents_dhcp_spec.rb index ab45faa66..2d9ed79c3 100644 --- a/spec/classes/neutron_agents_dhcp_spec.rb +++ b/spec/classes/neutron_agents_dhcp_spec.rb @@ -48,6 +48,7 @@ describe 'neutron::agents::dhcp' do is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/enable_metadata_network').with_value(p[:enable_metadata_network]); is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dhcp_broadcast_reply').with_value(''); is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/ovs_integration_bridge').with_value(''); + is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value(''); is_expected.to contain_neutron_dhcp_agent_config('AGENT/availability_zone').with_value(''); end @@ -163,6 +164,17 @@ describe 'neutron::agents::dhcp' do end end + shared_examples_for 'enable advertisement of the DNS resolver on the host.' do + before do + params.merge!( + :dnsmasq_local_resolv => true + ) + end + it 'configures dnsmasq_local_resolv' do + is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value(params[:dnsmasq_config_file]) + end + end + shared_examples_for 'neutron dhcp agent with dnsmasq_dns_servers set' do before do params.merge!(