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 {
include ::openstacklib::defaults
$client_package = 'python-zaqarclient'
$client_package = 'python-zaqarclient'
case $::osfamily {
'RedHat': {
$package_name = 'openstack-zaqar'
$service_name = 'openstack-zaqar'
}
'Debian': {
$package_name = 'zaqar'
$service_name = 'zaqar'
$package_name = 'zaqar-server'
$service_name = 'zaqar-server'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: \

View File

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

View File

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

View File

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

View File

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