Merge "Use upstart for RadosGW instead of rc.d script"

This commit is contained in:
Jenkins 2016-02-03 09:14:49 +00:00 committed by Gerrit Code Review
commit f6a76df7b0
3 changed files with 69 additions and 24 deletions

View File

@ -212,7 +212,7 @@ class ceph::radosgw (
exec { "Populate ${radosgw_auth_key} keyring":
command => "ceph auth get-or-create ${radosgw_auth_key} > ${keyring_path}",
creates => $keyring_path
creates => $keyring_path,
}
exec { "Create ${rgw_large_pool_name} pool":
@ -222,6 +222,11 @@ class ceph::radosgw (
file { $keyring_path: mode => '0640', }
file {"${rgw_data}/ceph-${rgw_id}/done":
ensure => present,
mode => '0644',
}
Ceph_conf <||> ->
Package<| title == 'httpd' |> ->
Package[[$::ceph::params::package_radosgw,
@ -238,6 +243,7 @@ class ceph::radosgw (
$rgw_log_file,]] ->
Exec["ceph create ${radosgw_auth_key}"] ->
Exec["Populate ${radosgw_auth_key} keyring"] ->
File["${rgw_data}/ceph-${rgw_id}/done"] ->
File[$keyring_path] ->
Exec["Create ${rgw_large_pool_name} pool"] ->
Firewall['012 RadosGW allow'] ~>

View File

@ -1,17 +1,40 @@
notice('MODULAR: ceph/enable_rados.pp')
include ::ceph::params
$radosgw_service = $::ceph::params::service_radosgw
$radosgw_service = $::ceph::params::service_radosgw
$radosgw_override_file = '/etc/init/radosgw-all.override'
# ensure the service is running and will start on boot
service { $radosgw_service:
ensure => running,
enable => true,
}
# The Ubuntu upstart script is incompatible with the upstart provider
# This will force the service to fall back to the debian init script
if ($::operatingsystem == 'Ubuntu') {
Service['radosgw'] {
provider => 'debian'
# ensure the service is stopped and will not start on boot
service { 'radosgw':
enable => false,
provider => 'debian',
}
service { 'radosgw-all':
ensure => running,
enable => true,
provider => 'upstart',
}
file {$radosgw_override_file:
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
content => "start on runlevel [2345]\nstop on starting rc RUNLEVEL=[016]\n",
}
Service['radosgw'] ->
File[$radosgw_override_file] ~>
Service['radosgw-all']
}
else {
service { $radosgw_service:
ensure => running,
enable => true,
}
}

View File

@ -5,22 +5,38 @@ manifest = 'ceph/enable_rados.pp'
describe manifest do
shared_examples 'catalog' do
it "should contain radowgw service" do
case facts[:operatingsystem]
when 'Ubuntu'
service_name = 'radosgw'
when 'CentOS'
service_name = 'ceph-radosgw'
end
should contain_service(service_name).with(
'ensure' => 'running',
'enable' => 'true'
)
if facts[:operatingsystem] == 'Ubuntu'
should contain_service('radosgw').with(
:enable => 'false',
:provider => 'debian'
)
if (facts[:operatingsystem] == 'Ubuntu')
should contain_service(service_name).with_provider('debian')
should contain_service('radosgw-all').with(
:ensure => 'running',
:enable => 'true',
:provider => 'upstart'
)
else
should contain_service('ceph-radosgw').with(
:ensure => 'running',
:enable => 'true'
)
end
end
it "should create radosgw init override file on Ubuntu" do
if facts[:operatingsystem] == 'Ubuntu'
should contain_file("/etc/init/radosgw-all.override").with(
:ensure => 'present',
:mode => '0644',
:owner => 'root',
:group => 'root',
:content => "start on runlevel [2345]\nstop on starting rc RUNLEVEL=[016]\n"
)
end
end
end
test_ubuntu_and_centos manifest