More stict naming of OVS packages in L23network

Fix the lost dependency between openvswitch packages.
Remove unneeded 'if' statement for MLNX.

Closes-bug: #1347671
Related to: blueprint neutron-nsx-plugin-integration

Change-Id: I0bceb2d9c81e378c16d5416a5125bb67bf81fae5
This commit is contained in:
Sergey Vasilenko 2014-07-23 15:51:16 +04:00 committed by Andrey Danin
parent fb0e84c954
commit c7f01eaf70
2 changed files with 27 additions and 43 deletions

View File

@ -10,37 +10,38 @@ class l23network::l2 (
include ::l23network::params
if $use_ovs {
#include ::l23network::l2::use_ovs
#FIXME(adanin) Move this 'if' to the better place.
if has_key($::fuel_settings,'nsx_plugin') and $::fuel_settings['nsx_plugin']['metadata']['enabled'] {
class { 'plugin_neutronnsx::install_ovs': }
} else {
if $::operatingsystem == 'Ubuntu' {
package { 'openvswitch-datapath-lts-saucy-dkms': } ->
Package[$::l23network::params::ovs_packages]
case $::osfamily {
/(?i)debian/: {
package { 'openvswitch-datapath':
name => 'openvswitch-datapath-lts-saucy-dkms'
}
package { 'openvswitch-common':
name => 'openvswitch-switch'
}
}
if $::operatingsystem == 'Centos' {
package { 'kmod-openvswitch': } ->
Package[$::l23network::params::ovs_packages]
/(?i)redhat/: {
package { 'openvswitch-datapath':
name => 'kmod-openvswitch'
}
package { 'openvswitch-common':
name => 'openvswitch'
}
}
package {$::l23network::params::ovs_packages: } ->
service {'openvswitch-service':
ensure => running,
name => $::l23network::params::ovs_service_name,
enable => true,
hasstatus => true,
status => $::l23network::params::ovs_status_cmd,
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}
Service['openvswitch-service'] -> L23network::L3::Ifconfig<||>
#FIXME(bogdando) assume ovs_packages has only 1 element, fix for many
Package<|title == 'openvswitch-datapath-lts-raring-dkms' or
title == $::l23network::params::ovs_packages[0] or
title == 'kmod-openvswitch'|> ~>
Service<| title == 'openvswitch-service'|>
}
Package['openvswitch-datapath'] -> Package['openvswitch-common'] ~> Service['openvswitch-service']
service {'openvswitch-service':
ensure => running,
name => $::l23network::params::ovs_service_name,
enable => true,
hasstatus => true,
status => $::l23network::params::ovs_status_cmd,
}
Service['openvswitch-service'] -> L23network::L3::Ifconfig<||>
if !defined(Service['openvswitch-service']) {
notify{ "Module ${module_name} cannot notify service openvswitch-service\
on packages update": }
notify{ "Module ${module_name} cannot notify service openvswitch-service on packages update": }
}
}

View File

@ -3,7 +3,6 @@ class l23network::params {
/(?i)debian/: {
$ovs_service_name = 'openvswitch-switch'
$ovs_status_cmd = '/etc/init.d/openvswitch-switch status'
$ovs_packages = ['openvswitch-switch']
$lnx_vlan_tools = 'vlan'
$lnx_bond_tools = 'ifenslave'
$lnx_ethernet_tools = 'ethtool'
@ -11,26 +10,10 @@ class l23network::params {
/(?i)redhat/: {
$ovs_service_name = 'openvswitch' #'ovs-vswitchd'
$ovs_status_cmd = '/etc/init.d/openvswitch status'
$ovs_packages = ['openvswitch']
$lnx_vlan_tools = 'vconfig'
$lnx_bond_tools = undef
$lnx_ethernet_tools = 'ethtool'
}
/(?i)linux/: {
case $::operatingsystem {
/(?i)archlinux/: {
$ovs_service_name = 'openvswitch.service'
$ovs_status_cmd = 'systemctl status openvswitch'
$ovs_packages = ['aur/openvswitch']
$lnx_vlan_tools = 'aur/vconfig'
$lnx_bond_tools = 'core/ifenslave'
$lnx_ethernet_tools = 'extra/ethtool'
}
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}
}
}
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}