add upstart symlink

the service upstart provider does not
work unless the init script is a symlink
to /lib/init/upstart-job for at least older
versions of Puppet.

This commit adds this symlink to avoid
run time apply failures.
This commit is contained in:
Dan Bode
2013-01-11 14:47:21 -08:00
parent 809a99f08b
commit 3d2462bd78
2 changed files with 29 additions and 1 deletions

View File

@@ -24,11 +24,15 @@ class swift::storage::container(
source => 'puppet:///modules/swift/swift-container-sync.conf.upstart', source => 'puppet:///modules/swift/swift-container-sync.conf.upstart',
require => Package['swift-container'], require => Package['swift-container'],
} }
file { '/etc/init.d/swift-container-sync':
ensure => link,
target => '/lib/init/upstart-job',
}
service { 'swift-container-sync': service { 'swift-container-sync':
ensure => running, ensure => running,
enable => true, enable => true,
provider => $::swift::params::service_provider, provider => $::swift::params::service_provider,
require => File['/etc/init/swift-container-sync.conf'] require => File['/etc/init/swift-container-sync.conf', '/etc/init.d/swift-container-sync']
} }
} }
} }

View File

@@ -29,6 +29,30 @@ describe 'swift::storage::container' do
param_set param_set
end end
it { should contain_swift__storage__generic('container').with_package_ensure(param_hash[:package_ensure]) } it { should contain_swift__storage__generic('container').with_package_ensure(param_hash[:package_ensure]) }
it 'should have some other services' do
['swift-container-updater', 'swift-container-auditor'].each do |service|
should contain_service(service).with(
:ensure => 'running',
:enable => true,
:provider => 'upstart',
:require => 'Package[swift-container]'
)
end
should contain_service('swift-container-sync').with(
:ensure => 'running',
:enable => true,
:provider => 'upstart',
:require => ['File[/etc/init/swift-container-sync.conf]', 'File[/etc/init.d/swift-container-sync]']
)
should contain_file('/etc/init/swift-container-sync.conf').with(
:source => 'puppet:///modules/swift/swift-container-sync.conf.upstart',
:require => 'Package[swift-container]'
)
should contain_file('/etc/init.d/swift-container-sync').with(
:ensure => 'link',
:target => '/lib/init/upstart-job'
)
end
end end
end end
end end