Merge "Use upstart for RadosGW instead of rc.d script"
This commit is contained in:
commit
f6a76df7b0
|
@ -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'] ~>
|
||||
|
|
|
@ -1,17 +1,40 @@
|
|||
notice('MODULAR: ceph/enable_rados.pp')
|
||||
|
||||
include ::ceph::params
|
||||
|
||||
$radosgw_service = $::ceph::params::service_radosgw
|
||||
$radosgw_override_file = '/etc/init/radosgw-all.override'
|
||||
|
||||
# ensure the service is running and will start on boot
|
||||
if ($::operatingsystem == 'Ubuntu') {
|
||||
# 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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 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'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,20 +5,36 @@ 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
|
||||
|
|
Loading…
Reference in New Issue