Start swift support services on Red Hat

Now starting these services on all distros
swift-account-auditor swift-container-auditor swift-object-auditor
swift-account-reaper swift-container-updater swift-object-updater

Change-Id: I98cfcef3b43a2bdad6f359e4e4098a6113245353
This commit is contained in:
Derek Higgins 2013-04-24 06:16:59 -04:00
parent 9a3a0b7c24
commit 90f58f8f92
7 changed files with 107 additions and 48 deletions

View File

@ -7,12 +7,18 @@ class swift::params {
$proxy_service_name = 'swift-proxy'
$object_package_name = 'swift-object'
$object_service_name = 'swift-object'
$object_auditor_service_name = 'swift-object-auditor'
$object_replicator_service_name = 'swift-object-replicator'
$object_updater_service_name = 'swift-object-updater'
$container_package_name = 'swift-container'
$container_service_name = 'swift-container'
$container_auditor_service_name = 'swift-container-auditor'
$container_replicator_service_name = 'swift-container-replicator'
$container_updater_service_name = 'swift-container-updater'
$account_package_name = 'swift-account'
$account_service_name = 'swift-account'
$account_auditor_service_name = 'swift-account-auditor'
$account_reaper_service_name = 'swift-account-reaper'
$account_replicator_service_name = 'swift-account-replicator'
$swift3 = 'swift-plugin-s3'
if $::operatingsystem == 'Debian' {
@ -28,12 +34,18 @@ class swift::params {
$proxy_service_name = 'openstack-swift-proxy'
$object_package_name = 'openstack-swift-object'
$object_service_name = 'openstack-swift-object'
$object_auditor_service_name = 'openstack-swift-object-auditor'
$object_replicator_service_name = 'openstack-swift-object-replicator'
$object_updater_service_name = 'openstack-swift-object-updater'
$container_package_name = 'openstack-swift-container'
$container_service_name = 'openstack-swift-container'
$container_auditor_service_name = 'openstack-swift-container-auditor'
$container_replicator_service_name = 'openstack-swift-container-replicator'
$container_updater_service_name = 'openstack-swift-container-updater'
$account_package_name = 'openstack-swift-account'
$account_service_name = 'openstack-swift-account'
$account_auditor_service_name = 'openstack-swift-account-auditor'
$account_reaper_service_name = 'openstack-swift-account-reaper'
$account_replicator_service_name = 'openstack-swift-account-replicator'
$service_provider = undef
$swift3 = 'openstack-swift-plugin-swift3'

View File

@ -5,22 +5,19 @@ class swift::storage::account(
package_ensure => $package_ensure,
}
# Not tested in other distros, safety measure
case $operatingsystem {
'Ubuntu','Debian': {
service { 'swift-account-reaper':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-account'],
}
service { 'swift-account-reaper':
name => $::swift::params::account_reaper_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-account'],
}
service { 'swift-account-auditor':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-account'],
}
}
service { 'swift-account-auditor':
name => $::swift::params::account_auditor_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-account'],
}
}

View File

@ -5,23 +5,21 @@ class swift::storage::container(
package_ensure => $package_ensure
}
# Not tested in other distros, safety measure
case $operatingsystem {
'Ubuntu','Debian': {
service { 'swift-container-updater':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-container'],
}
service { 'swift-container-auditor':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-container'],
}
}
service { 'swift-container-updater':
name => $::swift::params::container_updater_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-container'],
}
service { 'swift-container-auditor':
name => $::swift::params::container_auditor_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-container'],
}
if $operatingsystem == 'Ubuntu' {
# The following service conf is missing in Ubunty 12.04
file { '/etc/init/swift-container-sync.conf':

View File

@ -5,21 +5,18 @@ class swift::storage::object(
package_ensure => $package_ensure
}
# Not tested in other distros, safety measure
case $operatingsystem {
'Ubuntu','Debian': {
service { 'swift-object-updater':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-object'],
}
service { 'swift-object-auditor':
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-object'],
}
}
service { 'swift-object-updater':
name => $::swift::params::object_updater_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-object'],
}
service { 'swift-object-auditor':
name => $::swift::params::object_auditor_service_name,
ensure => running,
enable => true,
provider => $::swift::params::service_provider,
require => Package['swift-object'],
}
}

View File

@ -31,4 +31,22 @@ describe 'swift::storage::account' do
it { should contain_swift__storage__generic('account').with_package_ensure(param_hash[:package_ensure]) }
end
end
describe 'on rhel' do
let :facts do
{
:operatingsystem => 'RedHat',
:osfamily => 'RedHat'
}
end
it 'should have some support services' do
['swift-account-reaper', 'swift-account-auditor'].each do |service|
should contain_service(service).with(
:name => "openstack-#{service}",
:ensure => 'running',
:enable => true,
:require => 'Package[swift-account]'
)
end
end
end
end

View File

@ -55,4 +55,23 @@ describe 'swift::storage::container' do
end
end
end
describe 'on rhel' do
let :facts do
{
:operatingsystem => 'RedHat',
:osfamily => 'RedHat'
}
end
it 'should have some support services' do
['swift-container-updater', 'swift-container-auditor'].each do |service|
should contain_service(service).with(
:name => "openstack-#{service}",
:ensure => 'running',
:enable => true,
:require => 'Package[swift-container]'
)
end
end
end
end

View File

@ -31,4 +31,22 @@ describe 'swift::storage::object' do
it { should contain_swift__storage__generic('object').with_package_ensure(param_hash[:package_ensure]) }
end
end
describe 'on rhel' do
let :facts do
{
:operatingsystem => 'RedHat',
:osfamily => 'RedHat'
}
end
it 'should have some support services' do
['swift-object-updater', 'swift-object-auditor'].each do |service|
should contain_service(service).with(
:name => "openstack-#{service}",
:ensure => 'running',
:enable => true,
:require => 'Package[swift-object]'
)
end
end
end
end