kolla-ansible/ansible/roles/hacluster/tasks/bootstrap_service.yml
Matthew N Heler e1ae8223f9 hacluster: Use nodename to align with nova service names
For Masakari and HACluster to work properly, the hostnames used
in HACluster need to match with the hostnames used in Nova.

Change-Id: Iac917ef4471905caab591cd64eab379e150a8524
2023-02-18 04:33:59 +00:00

33 lines
1.4 KiB
YAML

---
- name: Ensure stonith is disabled
vars:
service: "{{ hacluster_services['hacluster-pacemaker'] }}"
command: "{{ kolla_container_engine }} exec {{ service.container_name }} crm_attribute --type crm_config --name stonith-enabled --update false"
run_once: true
become: true
delegate_to: "{{ groups[service.group][0] }}"
- name: Ensure remote node is added
vars:
pacemaker_service: "{{ hacluster_services['hacluster-pacemaker'] }}"
pacemaker_remote_service: "{{ hacluster_services['hacluster-pacemaker-remote'] }}"
shell: >
{{ kolla_container_engine }} exec {{ pacemaker_service.container_name }}
cibadmin --modify --scope resources -X '
<resources>
<primitive id="{{ ansible_facts.nodename }}" class="ocf" provider="pacemaker" type="remote">
<instance_attributes id="{{ ansible_facts.nodename }}-instance_attributes">
<nvpair id="{{ ansible_facts.nodename }}-instance_attributes-server" name="server" value="{{ 'api' | kolla_address }}"/>
</instance_attributes>
<operations>
<op id="{{ ansible_facts.nodename }}-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