Merge "network/dhcp: Update deprecated option dnsmasq_server"
This commit is contained in:
commit
84c133afb8
@ -18,7 +18,7 @@
|
|||||||
class cloud::network::dhcp(
|
class cloud::network::dhcp(
|
||||||
$veth_mtu = 1500,
|
$veth_mtu = 1500,
|
||||||
$debug = true,
|
$debug = true,
|
||||||
$dnsmasq_dns_server = false,
|
$dnsmasq_dns_servers = false,
|
||||||
$firewall_settings = {},
|
$firewall_settings = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -31,12 +31,12 @@ class cloud::network::dhcp(
|
|||||||
enable_isolated_metadata => true
|
enable_isolated_metadata => true
|
||||||
}
|
}
|
||||||
|
|
||||||
if $dnsmasq_dns_server {
|
if $dnsmasq_dns_servers {
|
||||||
neutron_dhcp_agent_config { 'DEFAULT/dnsmasq_dns_server':
|
neutron_dhcp_agent_config { 'DEFAULT/dnsmasq_dns_servers':
|
||||||
value => $dnsmasq_dns_server
|
value => join($dnsmasq_dns_servers, ',')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
neutron_dhcp_agent_config { 'DEFAULT/dnsmasq_dns_server':
|
neutron_dhcp_agent_config { 'DEFAULT/dnsmasq_dns_servers':
|
||||||
ensure => absent
|
ensure => absent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ describe 'cloud::network::dhcp' do
|
|||||||
:enable_isolated_metadata => true
|
:enable_isolated_metadata => true
|
||||||
)
|
)
|
||||||
|
|
||||||
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_ensure('absent')
|
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers').with_ensure('absent')
|
||||||
|
|
||||||
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
|
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
|
||||||
:mode => '0755',
|
:mode => '0755',
|
||||||
@ -94,7 +94,7 @@ describe 'cloud::network::dhcp' do
|
|||||||
let :params do
|
let :params do
|
||||||
{ :veth_mtu => '1400',
|
{ :veth_mtu => '1400',
|
||||||
:debug => true,
|
:debug => true,
|
||||||
:dnsmasq_dns_server => '1.2.3.4' }
|
:dnsmasq_dns_servers => ['1.2.3.4'] }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configure neutron dhcp' do
|
it 'configure neutron dhcp' do
|
||||||
@ -104,7 +104,7 @@ describe 'cloud::network::dhcp' do
|
|||||||
|
|
||||||
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf')
|
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf')
|
||||||
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/enable_isolated_metadata').with_value(true)
|
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/enable_isolated_metadata').with_value(true)
|
||||||
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_value('1.2.3.4')
|
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers').with_value('1.2.3.4')
|
||||||
|
|
||||||
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
|
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
|
||||||
:mode => '0755',
|
:mode => '0755',
|
||||||
@ -112,6 +112,12 @@ describe 'cloud::network::dhcp' do
|
|||||||
:group => 'root'
|
:group => 'root'
|
||||||
)
|
)
|
||||||
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/)
|
is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with more than one dns server' do
|
||||||
|
before { params.merge!(:dnsmasq_dns_servers => ['1.2.3.4','4.3.2.1','2.2.2.2']) }
|
||||||
|
it { is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers').with_value('1.2.3.4,4.3.2.1,2.2.2.2') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with default firewall enabled' do
|
context 'with default firewall enabled' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user