1

I'm trying to create an Ansible Pacemaker role that creates the CIB configuration and then pushes it. The problem is: Pacemaker refuses to destroy a resource if it is not stopped.

I'm trying then to figure out how to properly stop all the resources before restarting them (or destroy them, or shutdown the cluster, doesn't matter if the new CIB is pushed immediately after).

The best would have been to force destroy unused resources, but I can't figure out how crmsh can perform that.

Have you an idea ? Thanks!

moutonjr
  • 498
  • 5
  • 9

2 Answers2

1

There is a playbook to "Stop Pacemaker resources matching the given prefix string" published on https://github.com/larsks/osp-6-7-ansible/blob/master/playbooks/roles/pcs-stop-prefix/tasks/main.yml

Inspecting the source, it calls command: pcs resource disable {{item}} then it waits until resource becomes stopped by periodically parsing pcs status xml. The latter may be crucial in your case.

kubanczyk
  • 13,502
  • 5
  • 40
  • 55
0

The easiest way to stop all the resources in a Pacemaker cluster is to set the cluster property, "stop-all-resources" to "true".

If you're using 'crmsh':

# crm configure property stop-all-resources=true

If you're using 'pcs':

# pcs property set stop-all-resources=true

Hope that is helpful.

Matt Kereczman
  • 1,887
  • 8
  • 12