Merge "Add dnsmasq_dns_servers option support"

This commit is contained in:
Jenkins 2016-03-31 22:10:24 +00:00 committed by Gerrit Code Review
commit 98dce78cd7
3 changed files with 22 additions and 0 deletions

View File

@ -41,6 +41,10 @@
# (optional) Override the default dnsmasq settings with this file.
# Defaults to $::os_service_default
#
# [*dnsmasq_dns_servers*]
# (optional) List of servers to use as dnsmasq forwarders.
# Defaults to $::os_service_default.
#
# [*enable_isolated_metadata*]
# (optional) enable metadata support on isolated networks.
# Defaults to false.
@ -87,6 +91,7 @@ class neutron::agents::dhcp (
$dhcp_driver = 'neutron.agent.linux.dhcp.Dnsmasq',
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
$dnsmasq_config_file = $::os_service_default,
$dnsmasq_dns_servers = $::os_service_default,
$enable_isolated_metadata = false,
$enable_force_metadata = $::os_service_default,
$enable_metadata_network = false,
@ -138,6 +143,7 @@ class neutron::agents::dhcp (
'DEFAULT/root_helper': value => $root_helper;
'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), ',');
}
if ! is_service_default ($dhcp_delete_namespaces) {

View File

@ -0,0 +1,3 @@
---
features:
- Add 'dnsmasq_dns_servers' option support to dhcp agent settings.

View File

@ -155,6 +155,17 @@ describe 'neutron::agents::dhcp' do
end
end
shared_examples_for 'neutron dhcp agent with dnsmasq_dns_servers set' do
before do
params.merge!(
:dnsmasq_dns_servers => ['1.2.3.4','5.6.7.8']
)
end
it 'should set dnsmasq_dns_servers' do
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers').with_value(params[:dnsmasq_dns_servers].join(','))
end
end
shared_examples_for 'dnsmasq dhcp_driver' do
it 'installs dnsmasq packages' do
if platform_params.has_key?(:dhcp_agent_package)
@ -189,6 +200,7 @@ describe 'neutron::agents::dhcp' do
it_configures 'neutron dhcp agent'
it_configures 'neutron dhcp agent with dnsmasq_config_file specified'
it_configures 'neutron dhcp agent with dnsmasq_dns_servers set'
it 'configures subscription to neutron-dhcp-agent package' do
is_expected.to contain_service('neutron-dhcp-service').that_subscribes_to('Package[neutron-dhcp-agent]')
end
@ -210,5 +222,6 @@ describe 'neutron::agents::dhcp' do
it_configures 'neutron dhcp agent'
it_configures 'neutron dhcp agent with dnsmasq_config_file specified'
it_configures 'neutron dhcp agent with dnsmasq_dns_servers set'
end
end