chanchalbose.hacluster
ansible-hacluster
This role sets up a two-node high availability (HA) cluster using pcs, pacemaker, and corosync.
Requirements
The code has been partially tested on RHEL 7, and the version for Debian is still in development. The fencing device setup instructions in virtfence.yml
are just suggestions, so please adjust them as needed. Some parts of the code are still being tested, and we’ve marked any unsafe code with comments.
Role Variables
You need to set the following variables in defaults/main.yml
to match your environment:
hacluster_password
: Change_Mepcs_cluster1
: set_an_ip1pcs_cluster2
: set_an_ip2cluster_name
: set_namevirt_fencing
: falseip_of_esxi
: set_esxi_or_vcenter_ipsxi_username
: set_esxi_or_vcenter_usernamesxi_password
: set_esxi_or_vcenter_password
The tasks in virtfence.yml
will be disabled if virt_fencing
is set to false.
Dependencies
Currently, there are no dependencies. However, I plan to split the fencing code into its own role in the future.
Example Playbook
Here’s an example playbook to test this role:
---
- hosts: ['node1','node2']
become: true
remote_user: vagrant
roles:
- { role: ansible-hacluster, pcs_cluster1: node1, pcs_cluster2: node2, create_cluster: mycluster }
License
BSD
Author Information
Chanchal Bose
Company: Prodevans LLC
GitHub repo: chanchalbose
Docker repo: Chanchal
YouTube Channel: mostlylinux
Deploy HA Cluster using pcs, pacemaker and corosync on Redhat 7
ansible-galaxy install chanchalbose.hacluster