diff --git a/deployment/puppet/ceph/manifests/init.pp b/deployment/puppet/ceph/manifests/init.pp index 6710796695..63bbb5bb79 100644 --- a/deployment/puppet/ceph/manifests/init.pp +++ b/deployment/puppet/ceph/manifests/init.pp @@ -111,10 +111,11 @@ class ceph ( if roles_include(['primary-controller', 'controller', 'ceph-mon', 'ceph-osd']) { service { 'ceph': - ensure => 'running', - name => $ceph::params::service_name, - enable => true, - require => Class['ceph::conf'] + ensure => 'running', + name => $::ceph::params::service_name, + enable => true, + hasrestart => true, + require => Class['ceph::conf'] } Package<| title == 'ceph' |> ~> Service['ceph'] if !defined(Service['ceph']) { diff --git a/deployment/puppet/ceph/manifests/mon.pp b/deployment/puppet/ceph/manifests/mon.pp index 102f704199..bdcf711503 100644 --- a/deployment/puppet/ceph/manifests/mon.pp +++ b/deployment/puppet/ceph/manifests/mon.pp @@ -16,17 +16,16 @@ class ceph::mon ( exec {'ceph-deploy mon create': command => "ceph-deploy mon create ${node_hostname}:${mon_addr}", 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': - # this can be replaced with "ceph mon status mon.$::host" for Dumpling - command => 'ps ax|grep -vq ceph-create-keys', - returns => 0, - tries => 60, # This is necessary to prevent a race: mon must establish + command => "ceph mon stat | grep -q 'quorum.*${node_hostname}'", + tries => 12, # This is necessary to prevent a race: mon must establish # a quorum before it can generate keys, observed this takes upto 15 seconds # Keys must exist prior to other commands running - try_sleep => 1, + try_sleep => 5, + refreshonly => true, } exec {'ceph-deploy gatherkeys': @@ -38,7 +37,7 @@ class ceph::mon ( } Firewall['010 ceph-mon allow'] -> - Exec['ceph-deploy mon create'] -> + Exec['ceph-deploy mon create'] ~> Exec['Wait for Ceph quorum'] -> Exec['ceph-deploy gatherkeys'] @@ -52,15 +51,7 @@ class ceph::mon ( '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']] -> - Exec['reload Ceph for HA'] + Exec['Wait for Ceph quorum'] } } diff --git a/deployment/puppet/ceph/manifests/radosgw.pp b/deployment/puppet/ceph/manifests/radosgw.pp index 41dc76ee55..652829a38b 100644 --- a/deployment/puppet/ceph/manifests/radosgw.pp +++ b/deployment/puppet/ceph/manifests/radosgw.pp @@ -209,6 +209,7 @@ class ceph::radosgw ( exec { "ceph create ${radosgw_auth_key}": 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":