Added params for debian packages
Added the values for Debian osfamily with regards to the ovn packages. Change-Id: Ia6700a33472d44ed37ec6cdd30b80ea56ce65452
This commit is contained in:
parent
9c80a5bced
commit
c9dacb2c20
@ -10,9 +10,7 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Puppet module for the OVN project. At the moment this support OVN
|
Puppet module for the OVN project.
|
||||||
installation in Redhat platforms only. One can add the support for
|
|
||||||
other platforms by defining them in ovn::params module
|
|
||||||
|
|
||||||
## Module Description
|
## Module Description
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# ovn params
|
# ovn params
|
||||||
# == Class: ovn::params
|
# == Class: ovn::params
|
||||||
#
|
#
|
||||||
# This class defines the variable like
|
# This class defines the variable like
|
||||||
|
|
||||||
class ovn::params {
|
class ovn::params {
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
@ -11,6 +11,12 @@ class ovn::params {
|
|||||||
$ovn_northd_service_name = 'ovn-northd'
|
$ovn_northd_service_name = 'ovn-northd'
|
||||||
$ovn_controller_service_name = 'ovn-controller'
|
$ovn_controller_service_name = 'ovn-controller'
|
||||||
}
|
}
|
||||||
|
'Debian': {
|
||||||
|
$ovn_northd_package_name = 'ovn-central'
|
||||||
|
$ovn_controller_package_name = 'ovn-host'
|
||||||
|
$ovn_northd_service_name = 'ovn-central'
|
||||||
|
$ovn_controller_service_name = 'ovn-host'
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
fail " Osfamily ${::osfamily} not supported yet"
|
fail " Osfamily ${::osfamily} not supported yet"
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,14 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'ovn::controller' do
|
describe 'ovn::controller' do
|
||||||
|
|
||||||
let :redhat_platform_params do {
|
let :params do
|
||||||
:ovn_controller_package_name => 'openvswitch-ovn-host',
|
{ :ovn_remote => 'tcp:x.x.x.x:5000',
|
||||||
:ovn_controller_service_name => 'ovn-controller'
|
:ovn_encap_type => 'geneve',
|
||||||
}
|
:ovn_encap_ip => '1.2.3.4'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'ovn controller' do
|
shared_examples_for 'ovn controller' do
|
||||||
it 'includes params' do
|
it 'includes params' do
|
||||||
is_expected.to contain_class('ovn::params')
|
is_expected.to contain_class('ovn::params')
|
||||||
end
|
end
|
||||||
@ -54,21 +55,33 @@ describe 'ovn::controller' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with redhat platform' do
|
on_supported_os({
|
||||||
let :params do {
|
:supported_os => OSDefaults.get_supported_os
|
||||||
:ovn_remote => 'tcp:x.x.x.x:5000',
|
}).each do |os,facts|
|
||||||
:ovn_encap_type => 'geneve',
|
context "on #{os}" do
|
||||||
:ovn_encap_ip => '1.2.3.4'
|
let (:facts) do
|
||||||
}
|
facts.merge!(OSDefaults.get_facts({
|
||||||
|
}))
|
||||||
|
end
|
||||||
|
|
||||||
|
case facts[:osfamily]
|
||||||
|
when 'Debian'
|
||||||
|
let :platform_params do
|
||||||
|
{
|
||||||
|
:ovn_controller_package_name => 'ovn-host',
|
||||||
|
:ovn_controller_service_name => 'ovn-host'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it_behaves_like 'ovn controller'
|
||||||
|
when 'Redhat'
|
||||||
|
let :platform_params do
|
||||||
|
{
|
||||||
|
:ovn_controller_package_name => 'openvswitch-ovn-host',
|
||||||
|
:ovn_controller_service_name => 'ovn-controller'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it_behaves_like 'ovn controller'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
|
||||||
{:osfamily => 'Redhat',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_params do redhat_platform_params end
|
|
||||||
|
|
||||||
it_configures 'ovn controller'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,13 +2,7 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'ovn::northd' do
|
describe 'ovn::northd' do
|
||||||
|
|
||||||
let :redhat_platform_params do {
|
shared_examples_for 'ovn northd' do
|
||||||
:ovn_northd_package_name => 'openvswitch-ovn-central',
|
|
||||||
:ovn_northd_service_name => 'ovn-northd'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples 'ovn northd' do
|
|
||||||
it 'includes params' do
|
it 'includes params' do
|
||||||
is_expected.to contain_class('ovn::params')
|
is_expected.to contain_class('ovn::params')
|
||||||
end
|
end
|
||||||
@ -30,16 +24,34 @@ describe 'ovn::northd' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on redhat' do
|
on_supported_os({
|
||||||
let :platform_params do redhat_platform_params end
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({
|
||||||
|
}))
|
||||||
|
end
|
||||||
|
|
||||||
let :facts do
|
case facts[:osfamily]
|
||||||
{:osfamily => 'Redhat',
|
when 'Debian'
|
||||||
}
|
let(:platform_params) do
|
||||||
|
{
|
||||||
|
:ovn_northd_package_name => 'ovn-central',
|
||||||
|
:ovn_northd_service_name => 'ovn-central'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it_behaves_like 'ovn northd'
|
||||||
|
when 'Redhat'
|
||||||
|
let(:platform_params) do
|
||||||
|
{
|
||||||
|
:ovn_northd_package_name => 'openvswitch-ovn-central',
|
||||||
|
:ovn_northd_service_name => 'ovn-northd'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it_behaves_like 'ovn northd'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'ovn northd'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user