Remove sahara::service::all

Remove the class to deploy all sahara services in favor
of the specific classes for the API and engine.

Example see removal from RDO here [1].

[1] e5d05cc587

Change-Id: I43cb3e526211faa2192b18287bfed62617dec4b2
This commit is contained in:
Tobias Urdin 2020-01-14 10:54:20 +01:00
parent 1e75020d13
commit 11def8c8d9
4 changed files with 5 additions and 143 deletions

View File

@ -12,11 +12,8 @@ class sahara::params {
case $::osfamily {
'RedHat': {
$common_package_name = 'openstack-sahara-common'
$all_package_name = 'openstack-sahara'
$api_package_name = 'openstack-sahara-api'
$engine_package_name = 'openstack-sahara-engine'
# TODO(tobias-urdin): Remove this when deprecated sahara-all service is removed.
$all_service_name = 'openstack-sahara-all'
$api_service_name = 'openstack-sahara-api'
$engine_service_name = 'openstack-sahara-engine'
$sahara_wsgi_script_path = '/var/www/cgi-bin/sahara'
@ -24,10 +21,8 @@ class sahara::params {
}
'Debian': {
$common_package_name = 'sahara-common'
$all_package_name = 'sahara'
$api_package_name = 'sahara-api'
$engine_package_name = 'sahara-engine'
$all_service_name = 'sahara'
$api_service_name = 'sahara-api'
$engine_service_name = 'sahara-engine'
$sahara_wsgi_script_path = '/usr/lib/cgi-bin/sahara'

View File

@ -1,54 +0,0 @@
# == Class: sahara::service::all
#
# Installs & configure the Sahara combined API & Engine service
#
# === Parameters
#
# [*enabled*]
# (Optional) Should the service be enabled.
# Defaults to 'true'.
#
# [*manage_service*]
# (Optional) Whether the service should be managed by Puppet.
# Defaults to 'true'.
#
# [*package_ensure*]
# (Optional) Ensure state for package.
# Defaults to 'present'
#
class sahara::service::all (
$enabled = true,
$manage_service = true,
$package_ensure = 'present',
) {
include sahara::deps
include sahara::policy
include sahara::params
warning('The sahara::service::all service is deprecated and might not be working \
please move to using separate API and engine services.')
package { 'sahara-all':
ensure => $package_ensure,
name => $::sahara::params::all_package_name,
tag => ['openstack', 'sahara-package'],
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { 'sahara-all':
ensure => $service_ensure,
name => $::sahara::params::all_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => 'sahara-service',
}
}

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The deprecated sahara::service::all class is removed. Please use the specific
classes to deploy the API and engine services.

View File

@ -1,84 +0,0 @@
# TODO(tobias-urdin): Remove this when deprecated sahara-all is removed.
require 'spec_helper'
describe 'sahara::service::all' do
shared_examples 'sahara::service::all' do
context 'with default params' do
it {
should contain_class('sahara::deps')
should contain_class('sahara::policy')
should contain_class('sahara::params')
}
it { should contain_package('sahara-all').with(
:ensure => 'present',
:name => platform_params[:all_package_name],
:tag => ['openstack', 'sahara-package'],
)}
it { should contain_service('sahara-all').with(
:ensure => 'running',
:name => platform_params[:all_service_name],
:enable => true,
:hasstatus => true,
:hasrestart => true,
:tag => 'sahara-service',
)}
end
context 'with custom params' do
let :params do
{
:enabled => false,
:manage_service => false,
:package_ensure => 'absent',
}
end
it { should contain_package('sahara-all').with(
:ensure => 'absent',
:name => platform_params[:all_package_name],
:tag => ['openstack', 'sahara-package'],
)}
it { should contain_service('sahara-all').with(
:ensure => nil,
:name => platform_params[:all_service_name],
:enable => false,
:hasstatus => true,
:hasrestart => true,
:tag => 'sahara-service',
)}
end
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
case facts[:osfamily]
when 'Debian'
let (:platform_params) do
{
:all_package_name => 'sahara',
:all_service_name => 'sahara'
}
end
when 'RedHat'
let (:platform_params) do
{
:all_package_name => 'openstack-sahara',
:all_service_name => 'openstack-sahara-all'
}
end
end
it_behaves_like 'sahara::service::all'
end
end
end