Merge "Fix ceph mon/radosgw execs"
This commit is contained in:
commit
f4607e692c
@ -111,10 +111,11 @@ class ceph (
|
|||||||
|
|
||||||
if roles_include(['primary-controller', 'controller', 'ceph-mon', 'ceph-osd']) {
|
if roles_include(['primary-controller', 'controller', 'ceph-mon', 'ceph-osd']) {
|
||||||
service { 'ceph':
|
service { 'ceph':
|
||||||
ensure => 'running',
|
ensure => 'running',
|
||||||
name => $ceph::params::service_name,
|
name => $::ceph::params::service_name,
|
||||||
enable => true,
|
enable => true,
|
||||||
require => Class['ceph::conf']
|
hasrestart => true,
|
||||||
|
require => Class['ceph::conf']
|
||||||
}
|
}
|
||||||
Package<| title == 'ceph' |> ~> Service['ceph']
|
Package<| title == 'ceph' |> ~> Service['ceph']
|
||||||
if !defined(Service['ceph']) {
|
if !defined(Service['ceph']) {
|
||||||
|
@ -16,17 +16,16 @@ class ceph::mon (
|
|||||||
exec {'ceph-deploy mon create':
|
exec {'ceph-deploy mon create':
|
||||||
command => "ceph-deploy mon create ${node_hostname}:${mon_addr}",
|
command => "ceph-deploy mon create ${node_hostname}:${mon_addr}",
|
||||||
logoutput => true,
|
logoutput => true,
|
||||||
unless => "ceph mon dump | grep -E '^[0-9]+: +${mon_addr}:.* mon\\.${node_hostname}\$'",
|
unless => "ceph mon dump | grep -qE '^[0-9]+: +${mon_addr}:.* mon\\.${node_hostname}\$'",
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {'Wait for Ceph quorum':
|
exec {'Wait for Ceph quorum':
|
||||||
# this can be replaced with "ceph mon status mon.$::host" for Dumpling
|
command => "ceph mon stat | grep -q 'quorum.*${node_hostname}'",
|
||||||
command => 'ps ax|grep -vq ceph-create-keys',
|
tries => 12, # This is necessary to prevent a race: mon must establish
|
||||||
returns => 0,
|
|
||||||
tries => 60, # This is necessary to prevent a race: mon must establish
|
|
||||||
# a quorum before it can generate keys, observed this takes upto 15 seconds
|
# a quorum before it can generate keys, observed this takes upto 15 seconds
|
||||||
# Keys must exist prior to other commands running
|
# Keys must exist prior to other commands running
|
||||||
try_sleep => 1,
|
try_sleep => 5,
|
||||||
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {'ceph-deploy gatherkeys':
|
exec {'ceph-deploy gatherkeys':
|
||||||
@ -38,7 +37,7 @@ class ceph::mon (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Firewall['010 ceph-mon allow'] ->
|
Firewall['010 ceph-mon allow'] ->
|
||||||
Exec['ceph-deploy mon create'] ->
|
Exec['ceph-deploy mon create'] ~>
|
||||||
Exec['Wait for Ceph quorum'] ->
|
Exec['Wait for Ceph quorum'] ->
|
||||||
Exec['ceph-deploy gatherkeys']
|
Exec['ceph-deploy gatherkeys']
|
||||||
|
|
||||||
@ -52,15 +51,7 @@ class ceph::mon (
|
|||||||
'global/mon_initial_members': value => join($mon_hosts, ' ');
|
'global/mon_initial_members': value => join($mon_hosts, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
# Has to be an exec: Puppet can't reload a service without declaring
|
|
||||||
# an ordering relationship.
|
|
||||||
exec {'reload Ceph for HA':
|
|
||||||
command => 'service ceph reload',
|
|
||||||
subscribe => [Ceph_conf['global/mon_host'], Ceph_conf['global/mon_initial_members']]
|
|
||||||
}
|
|
||||||
|
|
||||||
Exec['ceph-deploy gatherkeys'] ->
|
|
||||||
Ceph_conf[['global/mon_host', 'global/mon_initial_members']] ->
|
Ceph_conf[['global/mon_host', 'global/mon_initial_members']] ->
|
||||||
Exec['reload Ceph for HA']
|
Exec['Wait for Ceph quorum']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,6 +209,7 @@ class ceph::radosgw (
|
|||||||
|
|
||||||
exec { "ceph create ${radosgw_auth_key}":
|
exec { "ceph create ${radosgw_auth_key}":
|
||||||
command => "ceph auth get-or-create ${radosgw_auth_key} osd 'allow rwx' mon 'allow rw'",
|
command => "ceph auth get-or-create ${radosgw_auth_key} osd 'allow rwx' mon 'allow rw'",
|
||||||
|
unless => "ceph auth list | fgrep -qx ${radosgw_auth_key}",
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "Populate ${radosgw_auth_key} keyring":
|
exec { "Populate ${radosgw_auth_key} keyring":
|
||||||
|
Loading…
Reference in New Issue
Block a user