Ondrej Famera - top logo

pcs-modules-2: ansible modules for configuring pacemaker clusters using 'pcs' utility

Since the initial version of roles for ansible to configure pacemaker cluster there was need to have modules that will interact with pacemaker in idempotent way. Initial version of 'pcs-modules' was trying to achieve this via importing functions used by 'pcs' utility from python. Unfortunatelly this was a fragile approach as there is not a stable API for interacting with pcs. Still pcs is a good idea to use as it handles most of the sanity checking before the actual cluster altering commands are used so I wanted to stick with it. New 'pcs-modules-2' are a complete rewrite into calls to 'pcs' script instead of importing parts of it. This works much better and still allows the idempotency to be achieved.

  • OndrejHome.pcs-modules-2

How to use pcs_* modules?

Check the ansible docs of these modules including the descriptions and examples of use of them. If you have for examle downloaded the 'OndrejHome.pcs-modules-2' roles into '/tmp/roles/OndrejHome.pcs-modules-2' then you can call the 'ansible-doc' command following way to get documentation.

ansible-doc -M /tmp/roles/OndrejHome.pcs-modules-2/library/ pcs_auth
ansible-doc -M /tmp/roles/OndrejHome.pcs-modules-2/library/ pcs_cluster
ansible-doc -M /tmp/roles/OndrejHome.pcs-modules-2/library/ pcs_resource
ansible-doc -M /tmp/roles/OndrejHome.pcs-modules-2/library/ pcs_constraint

These new modules were integrated into 'OndrejHome.ha-cluster-pacemaker' and 'OndrejHome.ha-cluster-lvm' roles. You should not spot any major difference in those roles but they should yield less 'always changed' tasks.

Last change .