Merge "FFU: Upgrades: fix pacemaker checks"

This commit is contained in:
Zuul 2018-03-16 14:43:35 +00:00 committed by Gerrit Code Review
commit 3253bba691
4 changed files with 73 additions and 26 deletions

View File

@ -157,8 +157,9 @@ The individual steps then correspond to the following tasks during the upgrade:
Prep steps:
- Step=1: Stop the cluster
- Step=2: Stop the service
- Step=0: Check running services
- Step=1: Stop the service
- Step=2: Stop the cluster
- Step=3: Update repos
Bootstrap steps:

View File

@ -311,11 +311,11 @@ outputs:
- name: set is_bootstrap_node fact
tags: common
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
- name: Check cluster resource status
- name: Check cluster resource status of redis
pacemaker_resource:
resource: {get_attr: [RedisBase, role_data, service_name]}
state: master
check_mode: true
state: show
check_mode: false
ignore_errors: true
register: redis_res
- when: (is_bootstrap_node) and (redis_res|succeeded)
@ -338,3 +338,35 @@ outputs:
until: output.rc == 0
- name: Disable redis service
service: name=redis enabled=no
fast_forward_upgrade_tasks:
- name: Check cluster resource status of redis
pacemaker_resource:
resource: {get_attr: [RedisBase, role_data, service_name]}
state: show
check_mode: false
ignore_errors: true
register: redis_res_result
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Set fact redis_res
set_fact:
redis_res: "{{ redis_res_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Disable the redis cluster resource
pacemaker_resource:
resource: {get_attr: [RedisBase, role_data, service_name]}
state: disable
wait_for_resource: true
register: redis_output
retries: 5
until: redis_output.rc == 0
when:
- step|int == 2
- release == 'ocata'
- is_bootstrap_node|bool
- redis_res|bool

View File

@ -271,11 +271,11 @@ outputs:
register: bootstrap_node
- name: set is_bootstrap_node fact
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
- name: Check cluster resource status
- name: Check cluster resource status of rabbitmq
pacemaker_resource:
resource: {get_attr: [RabbitmqBase, role_data, service_name]}
state: started
check_mode: true
check_mode: false
state: show
ignore_errors: true
register: rabbitmq_res
- when: (is_bootstrap_node) and (rabbitmq_res|succeeded)
@ -298,3 +298,35 @@ outputs:
until: output.rc == 0
- name: Disable rabbitmq service
service: name=rabbitmq-server enabled=no
fast_forward_upgrade_tasks:
- name: Check cluster resource status of rabbitmq
pacemaker_resource:
resource: {get_attr: [RabbitmqBase, role_data, service_name]}
state: show
check_mode: false
ignore_errors: true
register: rabbitmq_res_result
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Set fact rabbitmq_res
set_fact:
rabbitmq_res: "{{ rabbitmq_res_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Disable the rabitmq cluster resource
pacemaker_resource:
resource: {get_attr: [RabbitmqBase, role_data, service_name]}
state: disable
wait_for_resource: true
register: rabbitmq_output
retries: 5
until: rabbitmq_output.rc == 0
when:
- step|int == 2
- release == 'ocata'
- is_bootstrap_node|bool
- rabbitmq_res|bool

View File

@ -171,21 +171,3 @@ outputs:
- name: Start pacemaker cluster
when: step|int == 4
pacemaker_cluster: state=online
fast_forward_upgrade_tasks:
- name: get internal_api_virtual_ip
tags: common
command: hiera -c /etc/puppet/hiera.yaml tripleo::keepalived::internal_api_virtual_ip
register: internal_api_virtual_ip
- name: Disable all pacemaker resources except Api virtual ip, haproxy and galera
shell: |
pcs resource show --full |\
grep Resource |\
grep -v galera |\
grep -v haproxy |\
grep -v {{internal_api_virtual_ip.stdout}} |\
awk '{print $2}' |\
xargs pcs resource disable
when:
- step|int == 3
- release == 'ocata'
- is_bootstrap_node|bool