Merge pull request #273 from enovance/bug/270/emilien

network/dhcp: templatize dnsmasq configuration
This commit is contained in:
Gonéri Le Bouder
2014-02-19 11:57:20 +01:00
9 changed files with 27 additions and 15 deletions

View File

@@ -55,10 +55,6 @@
# (optional) Syslog facility to receive log lines
# Defaults value in params
#
# [*veth_mtu*]
# (optional) MTU for VM virtual network cards.
# Defaults value in params
#
class cloud::network(
$verbose = $os_params::verbose,
@@ -70,8 +66,7 @@ class cloud::network(
$provider_vlan_ranges = $os_params::provider_vlan_ranges,
$provider_bridge_mappings = $os_params::provider_bridge_mappings,
$use_syslog = $os_params::neutron_use_syslog,
$log_facility = $os_params::neutron_log_facility,
$veth_mtu = $os_params::veth_mtu
$log_facility = $os_params::neutron_log_facility
) {
class { 'neutron':
@@ -114,7 +109,6 @@ class cloud::network(
'agent/tunnel_types': value => ['gre'];
'agent/l2_population': value => true;
'agent/polling_interval': value => '2';
'agent/veth_mtu': value => $veth_mtu;
'OVS/local_ip': value => $tunnel_eth;
'OVS/enable_tunneling': value => true;
'OVS/integration_bridge': value => 'br-int';

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

@@ -32,7 +32,6 @@ describe 'cloud::network::controller' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end

View File

@@ -32,12 +32,12 @@ describe 'cloud::network::dhcp' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end
let :params do
{ :debug => true }
{ :veth_mtu => '1400',
:debug => true }
end
it 'configure neutron common' do
@@ -77,6 +77,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

@@ -32,7 +32,6 @@ describe 'cloud::network::l3' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end

View File

@@ -32,7 +32,6 @@ describe 'cloud::network::lbaas' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end

View File

@@ -32,7 +32,6 @@ describe 'cloud::network::metadata' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end

View File

@@ -32,7 +32,6 @@ describe 'cloud::network::vpn' do
verbose => true,
debug => true,
use_syslog => true,
veth_mtu => '1500',
log_facility => 'LOG_LOCAL0' }"
end

View File

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