Use puppet-kmod to manage GRE kernel module

Bug #414
This commit is contained in:
Emilien Macchi
2014-04-14 10:57:37 +02:00
parent 8b08b0f7c7
commit 6ca611881d
9 changed files with 93 additions and 3 deletions

View File

@@ -84,5 +84,8 @@ fixtures:
'boolean': 'boolean':
repo: 'git://github.com/enovance/puppet-boolean.git' repo: 'git://github.com/enovance/puppet-boolean.git'
ref: '157011a4eaa27f1202a9d94335ee4876b26d377e' ref: '157011a4eaa27f1202a9d94335ee4876b26d377e'
'kmod':
repo: 'git://github.com/enovance/puppet-kmod.git'
ref: 'accc40093e6f8ee9cc472e9eb6ba3bab4bad3a1f'
symlinks: symlinks:
'cloud': '#{source_dir}' 'cloud': '#{source_dir}'

View File

@@ -81,6 +81,9 @@ mod 'inifile',
mod 'keepalived', mod 'keepalived',
:git => 'git://github.com/enovance/puppet-module-keepalived.git', :git => 'git://github.com/enovance/puppet-module-keepalived.git',
:ref => 'eb345b6d3b25106cbe166028f2b8dd9974a10230' :ref => 'eb345b6d3b25106cbe166028f2b8dd9974a10230'
mod 'keepalived',
:git => 'git://github.com/enovance/puppet-kmod.git',
:ref => 'accc40093e6f8ee9cc472e9eb6ba3bab4bad3a1f'
mod 'kwalify', mod 'kwalify',
:git => 'git://github.com/puppetlabs/puppetlabs-kwalify.git', :git => 'git://github.com/puppetlabs/puppetlabs-kwalify.git',
:ref => 'e0079c6485d7cbfc846d956e650913e1b3ccfb6d' :ref => 'e0079c6485d7cbfc846d956e650913e1b3ccfb6d'

View File

@@ -81,9 +81,15 @@ class cloud::network(
} }
if $::osfamily == 'RedHat' { if $::osfamily == 'RedHat' {
exec { '/sbin/modprobe ip_gre': $gre_module_name = 'ip_gre'
unless => '/bin/grep -q "^ip_gre " "/proc/modules"' } else {
} $gre_module_name = 'gre'
}
kmod::generic {'install_gre':
type => 'install',
module => $gre_module_name,
file => '/etc/modprobe.d/neutron.conf'
} }
class { 'neutron': class { 'neutron':

View File

@@ -78,6 +78,11 @@ describe 'cloud::network::controller' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron server' do it 'configure neutron server' do
@@ -109,6 +114,10 @@ describe 'cloud::network::controller' do
:processorcount => '2' } :processorcount => '2' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network controller' it_configures 'openstack network controller'
end end
@@ -118,6 +127,10 @@ describe 'cloud::network::controller' do
:processorcount => '2' } :processorcount => '2' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network controller' it_configures 'openstack network controller'
end end

View File

@@ -73,6 +73,11 @@ describe 'cloud::network::dhcp' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron dhcp' do it 'configure neutron dhcp' do
@@ -97,6 +102,10 @@ describe 'cloud::network::dhcp' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network dhcp' it_configures 'openstack network dhcp'
end end
@@ -105,6 +114,10 @@ describe 'cloud::network::dhcp' do
{ :osfamily => 'RedHat' } { :osfamily => 'RedHat' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network dhcp' it_configures 'openstack network dhcp'
end end

View File

@@ -73,6 +73,11 @@ describe 'cloud::network::l3' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron l3' do it 'configure neutron l3' do
@@ -93,6 +98,10 @@ describe 'cloud::network::l3' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network l3' it_configures 'openstack network l3'
end end
@@ -101,6 +110,10 @@ describe 'cloud::network::l3' do
{ :osfamily => 'RedHat' } { :osfamily => 'RedHat' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network l3' it_configures 'openstack network l3'
end end

View File

@@ -73,6 +73,11 @@ describe 'cloud::network::lbaas' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron lbaas' do it 'configure neutron lbaas' do
@@ -114,6 +119,10 @@ describe 'cloud::network::lbaas' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network lbaas' it_configures 'openstack network lbaas'
end end
@@ -122,6 +131,10 @@ describe 'cloud::network::lbaas' do
{ :osfamily => 'RedHat' } { :osfamily => 'RedHat' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network lbaas' it_configures 'openstack network lbaas'
end end

View File

@@ -80,6 +80,11 @@ describe 'cloud::network::metadata' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron metadata' do it 'configure neutron metadata' do
@@ -100,6 +105,10 @@ describe 'cloud::network::metadata' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network metadata' it_configures 'openstack network metadata'
end end
@@ -108,6 +117,10 @@ describe 'cloud::network::metadata' do
{ :osfamily => 'RedHat' } { :osfamily => 'RedHat' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network metadata' it_configures 'openstack network metadata'
end end

View File

@@ -68,6 +68,11 @@ describe 'cloud::network::vpn' do
:network_vlan_ranges => ['physnet1:1000:2999'], :network_vlan_ranges => ['physnet1:1000:2999'],
:enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' :enable_security_group => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) )
should contain_kmod__generic('install_gre').with(
:type => 'install',
:module => platform_params[:gre_module_name],
:file => '/etc/modprobe.d/neutron.conf'
)
end end
it 'configure neutron vpnaas' do it 'configure neutron vpnaas' do
@@ -80,6 +85,10 @@ describe 'cloud::network::vpn' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
let :platform_params do
{ :gre_module_name => 'gre' }
end
it_configures 'openstack network vpnaas' it_configures 'openstack network vpnaas'
end end
@@ -88,6 +97,10 @@ describe 'cloud::network::vpn' do
{ :osfamily => 'RedHat' } { :osfamily => 'RedHat' }
end end
let :platform_params do
{ :gre_module_name => 'ip_gre' }
end
it_configures 'openstack network vpnaas' it_configures 'openstack network vpnaas'
end end