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":
|
exec { "Populate ${radosgw_auth_key} keyring":
|
||||||
command => "ceph auth get-or-create ${radosgw_auth_key} > ${keyring_path}",
|
command => "ceph auth get-or-create ${radosgw_auth_key} > ${keyring_path}",
|
||||||
creates => $keyring_path
|
creates => $keyring_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "Create ${rgw_large_pool_name} pool":
|
exec { "Create ${rgw_large_pool_name} pool":
|
||||||
|
@ -222,6 +222,11 @@ class ceph::radosgw (
|
||||||
|
|
||||||
file { $keyring_path: mode => '0640', }
|
file { $keyring_path: mode => '0640', }
|
||||||
|
|
||||||
|
file {"${rgw_data}/ceph-${rgw_id}/done":
|
||||||
|
ensure => present,
|
||||||
|
mode => '0644',
|
||||||
|
}
|
||||||
|
|
||||||
Ceph_conf <||> ->
|
Ceph_conf <||> ->
|
||||||
Package<| title == 'httpd' |> ->
|
Package<| title == 'httpd' |> ->
|
||||||
Package[[$::ceph::params::package_radosgw,
|
Package[[$::ceph::params::package_radosgw,
|
||||||
|
@ -238,6 +243,7 @@ class ceph::radosgw (
|
||||||
$rgw_log_file,]] ->
|
$rgw_log_file,]] ->
|
||||||
Exec["ceph create ${radosgw_auth_key}"] ->
|
Exec["ceph create ${radosgw_auth_key}"] ->
|
||||||
Exec["Populate ${radosgw_auth_key} keyring"] ->
|
Exec["Populate ${radosgw_auth_key} keyring"] ->
|
||||||
|
File["${rgw_data}/ceph-${rgw_id}/done"] ->
|
||||||
File[$keyring_path] ->
|
File[$keyring_path] ->
|
||||||
Exec["Create ${rgw_large_pool_name} pool"] ->
|
Exec["Create ${rgw_large_pool_name} pool"] ->
|
||||||
Firewall['012 RadosGW allow'] ~>
|
Firewall['012 RadosGW allow'] ~>
|
||||||
|
|
|
@ -1,17 +1,40 @@
|
||||||
|
notice('MODULAR: ceph/enable_rados.pp')
|
||||||
|
|
||||||
include ::ceph::params
|
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') {
|
if ($::operatingsystem == 'Ubuntu') {
|
||||||
Service['radosgw'] {
|
# ensure the service is stopped and will not start on boot
|
||||||
provider => 'debian'
|
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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,38 @@ manifest = 'ceph/enable_rados.pp'
|
||||||
describe manifest do
|
describe manifest do
|
||||||
shared_examples 'catalog' do
|
shared_examples 'catalog' do
|
||||||
it "should contain radowgw service" 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(
|
if facts[:operatingsystem] == 'Ubuntu'
|
||||||
'ensure' => 'running',
|
should contain_service('radosgw').with(
|
||||||
'enable' => 'true'
|
:enable => 'false',
|
||||||
)
|
:provider => 'debian'
|
||||||
|
)
|
||||||
|
|
||||||
if (facts[:operatingsystem] == 'Ubuntu')
|
should contain_service('radosgw-all').with(
|
||||||
should contain_service(service_name).with_provider('debian')
|
:ensure => 'running',
|
||||||
|
:enable => 'true',
|
||||||
|
:provider => 'upstart'
|
||||||
|
)
|
||||||
|
else
|
||||||
|
should contain_service('ceph-radosgw').with(
|
||||||
|
:ensure => 'running',
|
||||||
|
:enable => 'true'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
test_ubuntu_and_centos manifest
|
test_ubuntu_and_centos manifest
|
||||||
|
|
Loading…
Reference in New Issue