Make cinder-manage db sync run on only one controller during upgrade

We got to ensure that the cinder-manage db sync is run on only one
controller.

Change-Id: I88a6aa4c49d893b95a26795fbfcf163a780fd0bc
Closes-Bug: #1709315
(cherry picked from commit 42d8a1c944)
This commit is contained in:
Sofer Athlan-Guyot 2017-08-08 15:18:42 +02:00 committed by Athlan-Guyot sofer
parent 5734c1e6fc
commit 5c3cbe721d
1 changed files with 13 additions and 7 deletions

View File

@ -51,11 +51,17 @@ outputs:
resource: openstack-cinder-volume
state: disable
wait_for_resource: true
- name: Sync cinder DB
- name: get bootstrap nodeid
tags: step5
command: cinder-manage db sync
- name: Start cinder_volume service (pacemaker)
tags: step5
pacemaker_resource:
resource: openstack-cinder-volume
state: enable
command: hiera bootstrap_nodeid
register: bootstrap_node
- block:
- name: Sync cinder DB
tags: step5
command: cinder-manage db sync
- name: Start cinder_volume service (pacemaker)
tags: step5
pacemaker_resource:
resource: openstack-cinder-volume
state: enable
when: bootstrap_node.stdout == ansible_hostname