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:
Matthew Black 2016-04-19 13:15:16 -04:00
parent 9c80a5bced
commit c9dacb2c20
4 changed files with 68 additions and 39 deletions

View File

@ -10,9 +10,7 @@
## Overview
Puppet module for the OVN project. At the moment this support OVN
installation in Redhat platforms only. One can add the support for
other platforms by defining them in ovn::params module
Puppet module for the OVN project.
## Module Description

View File

@ -1,7 +1,7 @@
# ovn params
# == Class: ovn::params
#
# This class defines the variable like
# This class defines the variable like
class ovn::params {
case $::osfamily {
@ -11,6 +11,12 @@ class ovn::params {
$ovn_northd_service_name = 'ovn-northd'
$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: {
fail " Osfamily ${::osfamily} not supported yet"
}

View File

@ -2,13 +2,14 @@ require 'spec_helper'
describe 'ovn::controller' do
let :redhat_platform_params do {
:ovn_controller_package_name => 'openvswitch-ovn-host',
:ovn_controller_service_name => 'ovn-controller'
}
let :params do
{ :ovn_remote => 'tcp:x.x.x.x:5000',
:ovn_encap_type => 'geneve',
:ovn_encap_ip => '1.2.3.4'
}
end
shared_examples 'ovn controller' do
shared_examples_for 'ovn controller' do
it 'includes params' do
is_expected.to contain_class('ovn::params')
end
@ -54,21 +55,33 @@ describe 'ovn::controller' do
end
end
context 'with redhat platform' do
let :params do {
:ovn_remote => 'tcp:x.x.x.x:5000',
:ovn_encap_type => 'geneve',
:ovn_encap_ip => '1.2.3.4'
}
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
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
let :facts do
{:osfamily => 'Redhat',
}
end
let :platform_params do redhat_platform_params end
it_configures 'ovn controller'
end
end

View File

@ -2,13 +2,7 @@ require 'spec_helper'
describe 'ovn::northd' do
let :redhat_platform_params do {
:ovn_northd_package_name => 'openvswitch-ovn-central',
:ovn_northd_service_name => 'ovn-northd'
}
end
shared_examples 'ovn northd' do
shared_examples_for 'ovn northd' do
it 'includes params' do
is_expected.to contain_class('ovn::params')
end
@ -30,16 +24,34 @@ describe 'ovn::northd' do
end
end
context 'on redhat' do
let :platform_params do redhat_platform_params end
on_supported_os({
: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
{:osfamily => 'Redhat',
}
case facts[:osfamily]
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
it_configures 'ovn northd'
end
end