9f578c85e0
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>
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
- name: Ensure config directories exist
|
|
file:
|
|
path: "{{ node_custom_config }}/{{ item }}"
|
|
state: directory
|
|
delegate_to: localhost
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
with_items:
|
|
- hacluster-corosync
|
|
- hacluster-pacemaker
|
|
|
|
- name: Check if Corosync authkey file exists
|
|
stat:
|
|
path: "{{ node_custom_config }}/hacluster-corosync/authkey"
|
|
delegate_to: localhost
|
|
run_once: True
|
|
register: hacluster_corosync_authkey_file
|
|
|
|
- name: Check if Pacemaker authkey file exists
|
|
stat:
|
|
path: "{{ node_custom_config }}/hacluster-pacemaker/authkey"
|
|
delegate_to: localhost
|
|
run_once: True
|
|
register: hacluster_pacemaker_authkey_file
|
|
|
|
- name: Generating Corosync authkey file
|
|
command: "dd if=/dev/urandom of={{ node_custom_config }}/hacluster-corosync/authkey bs=4096 count=1"
|
|
delegate_to: localhost
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
when: not hacluster_corosync_authkey_file.stat.exists
|
|
|
|
- name: Generating Pacemaker authkey file
|
|
command: "dd if=/dev/urandom of={{ node_custom_config }}/hacluster-pacemaker/authkey bs=4096 count=1"
|
|
delegate_to: localhost
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
when: not hacluster_pacemaker_authkey_file.stat.exists
|