Fix instance-ha role to fully support ocata

This commit includes all the fixes needed to support ocata release.
It also simplifies the way playbook can be invoked by leaving a single
variable named instance_ha_config that can be "apply" or "undo" to
reflect what has been made in the stonith role.

Change-Id: Ib392f92172d79c8aef879bc106aa59e146949af0
This commit is contained in:
Raoul Scarazzini 2017-08-02 12:17:41 -04:00
parent c440ae7b18
commit 1a587b9552
5 changed files with 31 additions and 30 deletions

View File

@ -1,11 +1,5 @@
---
- name: Configure STONITH for all the hosts on the overcloud
hosts: undercloud
gather_facts: no
roles:
- stonith-config
- name: Configure Instance HA
hosts: undercloud
gather_facts: no

View File

@ -3,5 +3,5 @@
overcloud_working_dir: "/home/heat-admin"
working_dir: "/home/stack"
apply_instance_ha: true
undo_instance_ha: false
# apply or undo
instance_ha_config: apply

View File

@ -1,4 +1,10 @@
---
- name: Apply STONITH for compute nodes
include_role:
name: stonith-config
vars:
stonith_devices: "computes"
- name: Disable openstack-nova-compute on compute
service:
name: openstack-nova-compute
@ -102,6 +108,12 @@
cat {{ working_dir }}/overcloudrc
register: overcloudrc
- name: Remove overcloudrc file on overcloud-controller-0 (if exists)
file:
path: "{{ overcloud_working_dir }}/overcloudrc"
state: absent
delegate_to: overcloud-controller-0
- name: Copy overcloudrc file on overcloud-controller-0
lineinfile:
destfile: "{{ overcloud_working_dir }}/overcloudrc"

View File

@ -1,7 +1,7 @@
---
- include: apply.yml
when: apply_instance_ha|bool
- include: apply.yml
when: instance_ha_config == 'apply'
- include: undo.yml
when: undo_instance_ha|bool
when: instance_ha_config == 'undo'

View File

@ -65,24 +65,12 @@
pcs --force resource delete $resourceid
done
- name: Erase the status entries corresponding to the compute nodes
shell: |
cibadmin --delete --xml-text "<node id='{{ item }}'/>"
cibadmin --delete --xml-text "<node_state id={{ item }}'/>"
with_items:
- "{{ groups['compute'] }}"
- name: Delete pacemaker compute remote resource
shell: pcs resource delete {{ item }}
with_items: "{{ groups['compute'] }}"
- name: Delete pacemaker compute remote node
shell: crm_node --force --remove {{ item }}
with_items: "{{ groups['compute'] }}"
- name: Delete resource nova-evacuate
shell: >
pcs resource delete nova-evacuate
# - name: Erase the status entries corresponding to the compute nodes
# shell: |
# cibadmin --delete --xml-text "<node id='{{ item }}'/>"
# cibadmin --delete --xml-text "<node_state id={{ item }}'/>"
# with_items:
# - "{{ groups['compute'] }}"
- name: Remove constraints related to role controller
shell: |
@ -186,3 +174,10 @@
with_items:
- "{{ groups['controller'] }}"
- "{{ groups['compute'] }}"
- name: Undo STONITH for compute nodes
include_role:
name: stonith-config
vars:
stonith_config: "undo"
stonith_devices: "computes"