Add support for Debian system

We can add suport for Debian system due to have the
zaqar package in Debian system.
The Debian system does not support the use of services to run
a second instance, because there is no zaqar-server@.service
in zaqar package, so do not test it. I will Re-test it after
the zaqar package solve the problem.

Change-Id: I026b7d8f2b5994114d5a319200ed7c7d099b4fb5
This commit is contained in:
ZhongShengping 2016-11-20 23:52:10 +08:00
parent f1f794ccca
commit 7cf66df9e1
5 changed files with 37 additions and 32 deletions

View File

@ -4,15 +4,17 @@
# #
class zaqar::params { class zaqar::params {
include ::openstacklib::defaults include ::openstacklib::defaults
$client_package = 'python-zaqarclient'
$client_package = 'python-zaqarclient'
case $::osfamily { case $::osfamily {
'RedHat': { 'RedHat': {
$package_name = 'openstack-zaqar' $package_name = 'openstack-zaqar'
$service_name = 'openstack-zaqar' $service_name = 'openstack-zaqar'
} }
'Debian': { 'Debian': {
$package_name = 'zaqar' $package_name = 'zaqar-server'
$service_name = 'zaqar' $service_name = 'zaqar-server'
} }
default: { default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: \ fail("Unsupported osfamily: ${::osfamily} operatingsystem: \

View File

@ -24,32 +24,37 @@ describe 'basic zaqar' do
class { '::mongodb::server': class { '::mongodb::server':
replset => 'zaqar', replset => 'zaqar',
replset_members => ['127.0.0.1:27017'], replset_members => ['127.0.0.1:27017'],
dbpath_fix => false,
} }
$zaqar_mongodb_conn_string = 'mongodb://127.0.0.1:27017' $zaqar_mongodb_conn_string = 'mongodb://127.0.0.1:27017'
case $::osfamily { Mongodb_replset['zaqar'] -> Package['zaqar-common']
'Debian': {
warning('Zaqar is not yet packaged on Ubuntu systems.') # TODO(zhongshengping): temporarily added this package
if $::osfamily == 'Debian' {
package { 'python-pymongo':
ensure => present,
} }
'RedHat': { }
Mongodb_replset['zaqar'] -> Package['zaqar-common']
class {'::zaqar::management::mongodb': class {'::zaqar::management::mongodb':
uri => $zaqar_mongodb_conn_string uri => $zaqar_mongodb_conn_string
} }
class {'::zaqar::messaging::mongodb': class {'::zaqar::messaging::mongodb':
uri => $zaqar_mongodb_conn_string uri => $zaqar_mongodb_conn_string
} }
class {'::zaqar::keystone::authtoken': class {'::zaqar::keystone::authtoken':
password => 'a_big_secret', password => 'a_big_secret',
} }
class {'::zaqar': class {'::zaqar':
unreliable => true, unreliable => true,
} }
include ::zaqar::server include ::zaqar::server
# run a second instance using websockets # run a second instance using websockets, the Debian system does
zaqar::server_instance{ '1': # not support the use of services to run a second instance.
transport => 'websocket' if $::osfamily == 'RedHat' {
} zaqar::server_instance{ '1':
transport => 'websocket'
} }
} }
EOS EOS
@ -60,10 +65,8 @@ describe 'basic zaqar' do
apply_manifest(pp, :catch_changes => true) apply_manifest(pp, :catch_changes => true)
end end
if os[:family].casecmp('RedHat') == 0 describe port(8888) do
describe port(8888) do it { is_expected.to be_listening.with('tcp') }
it { is_expected.to be_listening.with('tcp') }
end
end end
end end

View File

@ -75,7 +75,7 @@ describe 'zaqar' do
let(:platform_params) do let(:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'Debian' when 'Debian'
{ :zaqar_common_package => 'zaqar' } { :zaqar_common_package => 'zaqar-server' }
when 'RedHat' when 'RedHat'
{ :zaqar_common_package => 'openstack-zaqar' } { :zaqar_common_package => 'openstack-zaqar' }
end end

View File

@ -29,7 +29,7 @@ describe 'zaqar::server' do
let(:platform_params) do let(:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'Debian' when 'Debian'
{ :zaqar_service_name => 'zaqar' } { :zaqar_service_name => 'zaqar-server' }
when 'RedHat' when 'RedHat'
{ :zaqar_service_name => 'openstack-zaqar' } { :zaqar_service_name => 'openstack-zaqar' }
end end

View File

@ -39,7 +39,7 @@ describe 'zaqar::server_instance' do
let(:platform_params) do let(:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'Debian' when 'Debian'
{ :zaqar_service_name => 'zaqar' } { :zaqar_service_name => 'zaqar-server' }
when 'RedHat' when 'RedHat'
{ :zaqar_service_name => 'openstack-zaqar' } { :zaqar_service_name => 'openstack-zaqar' }
end end