Merge pull request #273 from enovance/bug/270/emilien
network/dhcp: templatize dnsmasq configuration
This commit is contained in:
@@ -55,10 +55,6 @@
|
|||||||
# (optional) Syslog facility to receive log lines
|
# (optional) Syslog facility to receive log lines
|
||||||
# Defaults value in params
|
# Defaults value in params
|
||||||
#
|
#
|
||||||
# [*veth_mtu*]
|
|
||||||
# (optional) MTU for VM virtual network cards.
|
|
||||||
# Defaults value in params
|
|
||||||
#
|
|
||||||
|
|
||||||
class cloud::network(
|
class cloud::network(
|
||||||
$verbose = $os_params::verbose,
|
$verbose = $os_params::verbose,
|
||||||
@@ -70,8 +66,7 @@ class cloud::network(
|
|||||||
$provider_vlan_ranges = $os_params::provider_vlan_ranges,
|
$provider_vlan_ranges = $os_params::provider_vlan_ranges,
|
||||||
$provider_bridge_mappings = $os_params::provider_bridge_mappings,
|
$provider_bridge_mappings = $os_params::provider_bridge_mappings,
|
||||||
$use_syslog = $os_params::neutron_use_syslog,
|
$use_syslog = $os_params::neutron_use_syslog,
|
||||||
$log_facility = $os_params::neutron_log_facility,
|
$log_facility = $os_params::neutron_log_facility
|
||||||
$veth_mtu = $os_params::veth_mtu
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
class { 'neutron':
|
class { 'neutron':
|
||||||
@@ -114,7 +109,6 @@ class cloud::network(
|
|||||||
'agent/tunnel_types': value => ['gre'];
|
'agent/tunnel_types': value => ['gre'];
|
||||||
'agent/l2_population': value => true;
|
'agent/l2_population': value => true;
|
||||||
'agent/polling_interval': value => '2';
|
'agent/polling_interval': value => '2';
|
||||||
'agent/veth_mtu': value => $veth_mtu;
|
|
||||||
'OVS/local_ip': value => $tunnel_eth;
|
'OVS/local_ip': value => $tunnel_eth;
|
||||||
'OVS/enable_tunneling': value => true;
|
'OVS/enable_tunneling': value => true;
|
||||||
'OVS/integration_bridge': value => 'br-int';
|
'OVS/integration_bridge': value => 'br-int';
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
class cloud::network::dhcp(
|
class cloud::network::dhcp(
|
||||||
|
$veth_mtu = $os_params::veth_mtu,
|
||||||
$debug = $os_params::debug
|
$debug = $os_params::debug
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -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']
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,6 @@ describe 'cloud::network::controller' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -32,12 +32,12 @@ describe 'cloud::network::dhcp' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
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 +77,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
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@ describe 'cloud::network::l3' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@ describe 'cloud::network::lbaas' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@ describe 'cloud::network::metadata' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@ describe 'cloud::network::vpn' do
|
|||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true,
|
debug => true,
|
||||||
use_syslog => true,
|
use_syslog => true,
|
||||||
veth_mtu => '1500',
|
|
||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
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 %>
|
Reference in New Issue
Block a user