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:
Emilien Macchi 2014-02-18 19:43:42 +01:00
parent 2b14e79133
commit e5fa32b1da
3 changed files with 26 additions and 2 deletions

View File

@ -17,7 +17,8 @@
#
class cloud::network::dhcp(
$debug = $os_params::debug
$veth_mtu = $os_params::veth_mtu,
$debug = $os_params::debug
) {
include 'cloud::network'
@ -26,4 +27,16 @@ class cloud::network::dhcp(
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']
}
}

View File

@ -37,7 +37,8 @@ describe 'cloud::network::dhcp' do
end
let :params do
{ :debug => true }
{ :veth_mtu => '1400',
:debug => true }
end
it 'configure neutron common' do
@ -77,6 +78,15 @@ describe 'cloud::network::dhcp' do
should contain_class('neutron::agents::dhcp').with(
: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

View File

@ -0,0 +1 @@
dhcp-options-force=26,<%= @veth_mtu %>