Adds HAcluster Ansible role. This role contains High Availability clustering solution composed of Corosync, Pacemaker and Pacemaker Remote. HAcluster is added as a helper role for Masakari which requires it for its host monitoring, allowing to provide HA to instances on a failed compute host. Kolla hacluster images merged in [1]. [1] https://review.opendev.org/#/c/668765/ Change-Id: I91e5c1840ace8f567daf462c4eb3ec1f0c503823 Implements: blueprint ansible-pacemaker-support Co-Authored-By: Radosław Piliszek <radoslaw.piliszek@gmail.com> Co-Authored-By: Mark Goddard <mark@stackhpc.com>
35 lines
1.4 KiB
YAML
35 lines
1.4 KiB
YAML
---
|
|
- name: Ensure stonith is disabled
|
|
vars:
|
|
service: "{{ hacluster_services['hacluster-pacemaker'] }}"
|
|
command: docker exec {{ service.container_name }} crm_attribute --type crm_config --name stonith-enabled --update false
|
|
run_once: true
|
|
become: true
|
|
when:
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
|
|
- name: Ensure remote node is added
|
|
vars:
|
|
pacemaker_service: "{{ hacluster_services['hacluster-pacemaker'] }}"
|
|
pacemaker_remote_service: "{{ hacluster_services['hacluster-pacemaker-remote'] }}"
|
|
shell: >
|
|
docker exec {{ pacemaker_service.container_name }}
|
|
cibadmin --modify --scope resources -X '
|
|
<resources>
|
|
<primitive id="{{ ansible_hostname }}" class="ocf" provider="pacemaker" type="remote">
|
|
<instance_attributes id="{{ ansible_hostname }}-instance_attributes">
|
|
<nvpair id="{{ ansible_hostname }}-instance_attributes-server" name="server" value="{{ 'api' | kolla_address }}"/>
|
|
</instance_attributes>
|
|
<operations>
|
|
<op id="{{ ansible_hostname }}-monitor" name="monitor" interval="60" timeout="30"/>
|
|
</operations>
|
|
</primitive>
|
|
</resources>
|
|
'
|
|
become: true
|
|
delegate_to: "{{ groups[pacemaker_service.group][0] }}"
|
|
when:
|
|
- inventory_hostname in groups[pacemaker_remote_service.group]
|
|
- pacemaker_remote_service.enabled | bool
|