Hi
I want to setup pacemaker to setup my HA. I want to use ansible for all setup, but I don’t know how to use the resources of the live console.
Pacemaker shell example:
http://clusterlabs.org/wiki/Debian_Lenny_HowTo#Configure_an_IP_resource
Anyone setup any tool like this? Any external module for make this?
Cheers.
IIRC, pacemaker lets you dump the configuration to a file. Seems like
you could just use a template and configure the cluster that way.
- James
Hi all,
A while ago I wrote about using Ansible to bootstrap Pacemaker. There is a blog post with some YAML examples at http://kafecho.blogspot.com/2013/03/using-ansible-for-configuration.html
In the post, I only describe how to install and configure Pacemaker nodes. Once your Pacemaker cluster is up, you could use the CRM command via the shell to deploy your primitives. I have written shell scripts in the past to do that.
For example, assuming that you want to deploy a primitive for HA Proxy with a floating IP address, you have a file called haproxy-stack with the following content:
primitive haproxy ocf:heartbeat:haproxy params conffile=/etc/haproxy/haproxy.cfg op monitor interval=30s
primitive haproxy-ip ocf:heartbeat:IPaddr2 params ip="10.162.20.107" cidr_netmask="24" op monitor interval="2s"
group haproxy-stack haproxy-ip haproxy
Send that file to the cluster nodes, then from a node within your cluster, run (via the shell) the crm command to update the cluster configuration with the content of the file:
crm configure load update haproxy-stack
You can use Ansible to template and push the file to the Pacemaker nodes, and use the shell module to load the snippet into the crm. I have not tried that last step but it should work.
I hope this helps.
Guillaume.
Hi
Lovely, yesterday finally generate the crm configure in file and make update command and works fine now, my task is like this:
Many thanks
I am glad that it worked.
Guillaume.
Hi ELOy
You have develop pacemaker to find the active node and do patchg first inactive mode and bring the server online inactive mode and migrate resources from active to inactive mode and do patch in another server