Condition if ovs is not already installed

Fix in the fact and manifest
Closes-Bug: #1540118

Change-Id: I2e1b721aca8b7385f24184a9a51cc620c70e5075
Signed-off-by: Stephane Wartel <stephane.wartel@deveryware.com>
This commit is contained in:
Stephane Wartel 2016-01-31 19:05:07 +01:00
parent 989e6a96d5
commit 231e5ca7d7
2 changed files with 11 additions and 6 deletions

View File

@ -2,6 +2,9 @@ Facter.add("ovs_version") do
confine :kernel => "Linux"
setcode do
Facter::Core::Execution.exec('/usr/bin/ovs-vsctl --version').gsub(/.*ovs-vsctl\s+\(Open\s+vSwitch\)\s+(\d+\.\d+\.\d+).*/, '\1')
ovs_ver = Facter::Core::Execution.exec('/usr/bin/ovs-vsctl --version')
if ovs_ver
ovs_ver.gsub(/.*ovs-vsctl\s+\(Open\s+vSwitch\)\s+(\d+\.\d+\.\d+).*/, '\1')
end
end
end

View File

@ -64,11 +64,13 @@ class vswitch::ovs(
status => $ovs_status,
}
$major_version = regsubst($::ovs_version, '^(\d+).*', '\1')
if $major_version == '1' {
$kernel_mod_file = "/lib/modules/${::kernelrelease}/updates/dkms/openvswitch_mod.ko"
} else {
$kernel_mod_file = "/lib/modules/${::kernelrelease}/updates/dkms/openvswitch.ko"
if $::ovs_version {
$major_version = regsubst($::ovs_version, '^(\d+).*', '\1')
if $major_version == '1' {
$kernel_mod_file = "/lib/modules/${::kernelrelease}/updates/dkms/openvswitch_mod.ko"
} else {
$kernel_mod_file = "/lib/modules/${::kernelrelease}/updates/dkms/openvswitch.ko"
}
}
}