Make cinder-manage db sync run on only one controller during upgrade
authorSofer Athlan-Guyot <sathlang@redhat.com>
Tue, 8 Aug 2017 13:18:42 +0000 (15:18 +0200)
committerSofer Athlan-Guyot <sathlang@redhat.com>
Tue, 8 Aug 2017 13:18:42 +0000 (15:18 +0200)
We got to ensure that the cinder-manage db sync is run on only one
controller.

Change-Id: I88a6aa4c49d893b95a26795fbfcf163a780fd0bc
Closes-Bug: #1709315

puppet/services/pacemaker/cinder-volume.yaml

index a1134f3..f467587 100644 (file)
@@ -66,11 +66,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