network/dhcp: templatize dnsmasq configuration
The only way I found to fix the MTU configuration is to use DHCP. To do that, we need to configure Neutron DHCP Agent and create a dedicated file. This file has been introduced as a new template. Close bug #270 Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
parent
2b14e79133
commit
e5fa32b1da
@ -17,7 +17,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
class cloud::network::dhcp(
|
class cloud::network::dhcp(
|
||||||
$debug = $os_params::debug
|
$veth_mtu = $os_params::veth_mtu,
|
||||||
|
$debug = $os_params::debug
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include 'cloud::network'
|
include 'cloud::network'
|
||||||
@ -26,4 +27,16 @@ class cloud::network::dhcp(
|
|||||||
debug => $debug
|
debug => $debug
|
||||||
}
|
}
|
||||||
|
|
||||||
|
neutron_dhcp_agent_config {
|
||||||
|
'DEFAULT/dnsmasq_config_file': value => '/etc/neutron/dnsmasq-neutron.conf';
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/etc/neutron/dnsmasq-neutron.conf':
|
||||||
|
content => template('cloud/network/dnsmasq-neutron.conf.erb'),
|
||||||
|
owner => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
group => 'root',
|
||||||
|
notify => Service['neutron-dhcp-agent']
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,8 @@ describe 'cloud::network::dhcp' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :debug => true }
|
{ :veth_mtu => '1400',
|
||||||
|
:debug => true }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configure neutron common' do
|
it 'configure neutron common' do
|
||||||
@ -77,6 +78,15 @@ describe 'cloud::network::dhcp' do
|
|||||||
should contain_class('neutron::agents::dhcp').with(
|
should contain_class('neutron::agents::dhcp').with(
|
||||||
:debug => true
|
:debug => true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf')
|
||||||
|
|
||||||
|
should contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
|
||||||
|
:mode => '0755',
|
||||||
|
:owner => 'root',
|
||||||
|
:group => 'root'
|
||||||
|
)
|
||||||
|
verify_contents(subject, '/etc/neutron/dnsmasq-neutron.conf', ["dhcp-options-force=26,1400"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
1
templates/network/dnsmasq-neutron.conf.erb
Normal file
1
templates/network/dnsmasq-neutron.conf.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
dhcp-options-force=26,<%= @veth_mtu %>
|
Loading…
x
Reference in New Issue
Block a user