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 <emilien.macchi@enovance.com>
This commit is contained in:
@@ -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'],
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user