Merge "FFU: Fix Cinder services action order"

This commit is contained in:
Zuul 2018-03-15 21:15:02 +00:00 committed by Gerrit Code Review
commit 749ba5fcf3
4 changed files with 82 additions and 18 deletions

View File

@ -248,13 +248,32 @@ outputs:
- name: Check is cinder_api is deployed
command: systemctl is-enabled --quiet openstack-cinder-api
ignore_errors: True
register: cinder_api_enabled
register: cinder_api_enabled_result
when:
- step|int == 0
- release == 'ocata'
- name: Set fact cinder_api_enabled
set_fact:
cinder_api_enabled: "{{ cinder_api_enabled_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- name: Stop openstack-cinder-api
service: name=openstack-cinder-api state=stopped
when:
- step|int == 2
- step|int == 1
- release == 'ocata'
- cinder_api_enabled.rc == 0
- cinder_api_enabled|bool
- name: Extra removal of services for cinder
shell: |
cinder-manage service list |\
grep -v Binary | tr '@' ' ' |\
awk '{print $1 " " $2}' |\
while read i ; do cinder-manage service remove $i ; done
when:
- step|int == 5
- release == 'pike'
- is_bootstrap_node|bool
- name: Extra migration for cinder
command: cinder-manage db online_data_migrations
when:
@ -262,12 +281,7 @@ outputs:
- release == 'pike'
- is_bootstrap_node|bool
- name: Cinder package update
command: yum update -y "{{ item }}"
with_items:
- puppet-cinder
- python2-cinderclient
- python-cinder
- openstack-cinder
yum: name=openstack-cinder* state=latest
when:
- step|int == 6
- is_bootstrap_node|bool

View File

@ -161,10 +161,19 @@ outputs:
- name: Check if cinder_scheduler is deployed
command: systemctl is-enabled --quiet openstack-cinder-scheduler
ignore_errors: True
register: cinder_scheduler_enabled
register: cinder_scheduler_enabled_result
when:
- step|int == 0
- release == 'ocata'
- name: Set fact cinder_scheduler_enabled
set_fact:
cinder_scheduler_enabled: "{{ cinder_scheduler_enabled_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- name: Stop openstack-cinder-scheduler
service: name=openstack-cinder-scheduler state=stopped enabled=no
when:
- step|int == 2
- step|int == 1
- release == 'ocata'
- cinder_scheduler_enabled.rc == 0
- cinder_scheduler_enabled|bool

View File

@ -236,10 +236,19 @@ outputs:
- name: Check if cinder_volume is deployed
command: systemctl is-enabled --quiet openstack-cinder-volume
ignore_errors: True
register: cinder_volume_enabled
register: cinder_volume_enabled_result
when:
- step|int == 0
- release == 'ocata'
- name: Set fact cinder_volume_enabled
set_fact:
cinder_volume_enabled: "{{ cinder_volume_enabled_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- name: Stop openstack-cinder-volume
service: name=openstack-cinder-volume state=stopped enabled=no
when:
- step|int == 2
- step|int == 1
- release == 'ocata'
- cinder_volume_enabled.rc == 0
- cinder_volume_enabled|bool

View File

@ -291,9 +291,9 @@ outputs:
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
- name: Check cluster resource status
pacemaker_resource:
resource: {get_attr: [CinderBase, role_data, service_name]}
state: started
check_mode: true
resource: openstack-cinder-volume
state: show
check_mode: false
ignore_errors: true
register: cinder_volume_res
- when: (is_bootstrap_node) and (cinder_volume_res|succeeded)
@ -316,3 +316,35 @@ outputs:
until: output.rc == 0
- name: Disable cinder_volume service from boot
service: name=openstack-cinder-volume enabled=no
fast_forward_upgrade_tasks:
- name: Check cluster resource status
pacemaker_resource:
resource: openstack-cinder-volume
state: show
check_mode: false
ignore_errors: true
register: cinder_volume_res_result
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Set fact cinder_volume_res
set_fact:
cinder_volume_res: "{{ cinder_volume_res_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- is_bootstrap_node|bool
- name: Disable the openstack-cinder-volume cluster resource
pacemaker_resource:
resource: openstack-cinder-volume
state: disable
wait_for_resource: true
register: cinder_volume_output
retries: 5
until: cinder_volume_output.rc == 0
when:
- step|int == 2
- release == 'ocata'
- is_bootstrap_node|bool
- cinder_volume_res|bool