From 59c0bf5cf97547193fb22f9678ef3ca452780dd8 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 20 Aug 2014 16:09:43 +0200 Subject: [PATCH] spof/debian: cleanup corosync resources if not started When bootstraping a corosync cluster, it happens that resources are in error. To ensure the resource is Started, we can run "crm cleanup" to ensure that the resource is up and running. Signed-off-by: Emilien Macchi --- manifests/spof.pp | 6 ++++++ spec/classes/cloud_spof_spec.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/manifests/spof.pp b/manifests/spof.pp index 932273f6..1afcffb1 100644 --- a/manifests/spof.pp +++ b/manifests/spof.pp @@ -111,6 +111,12 @@ class cloud::spof( on-fail => 'restart' } } + } -> + exec { 'cleanup_ceilometer_agent_central': + command => 'crm resource cleanup ceilometer-agent-central', + unless => 'crm resource show ceilometer-agent-central | grep Started', + user => 'root', + path => ['/usr/sbin', '/bin'], } } diff --git a/spec/classes/cloud_spof_spec.rb b/spec/classes/cloud_spof_spec.rb index 80bc697f..1539095a 100644 --- a/spec/classes/cloud_spof_spec.rb +++ b/spec/classes/cloud_spof_spec.rb @@ -48,6 +48,12 @@ describe 'cloud::spof' do :group => 'root' ) should contain_class('cloud::telemetry::centralagent').with(:enabled => false) + should contain_exec('cleanup_ceilometer_agent_central').with( + :command => 'crm resource cleanup ceilometer-agent-central', + :path => ['/usr/sbin', '/bin'], + :user => 'root', + :unless => 'crm resource show ceilometer-agent-central | grep Started' + ) end end