diff --git a/docker/services/cinder-volume.yaml b/docker/services/cinder-volume.yaml index a8c867f1b4..42476d823a 100644 --- a/docker/services/cinder-volume.yaml +++ b/docker/services/cinder-volume.yaml @@ -175,6 +175,17 @@ outputs: - name: Stop and disable cinder_volume service when: cinder_volume_enabled|bool service: name=openstack-cinder-volume state=stopped enabled=no + - name: Unmount cinder NFS shares mounted on the host + mount: + path: "{{ item.mount }}" + state: unmounted + loop: "{{ ansible_mounts }}" + loop_control: + label: "{{ item.mount }}" + index_var: cinder_mount_index + when: + - "'/var/lib/cinder/' in item.mount" + - "'nfs' in item.fstype" - when: step|int == 3 block: - name: Set fact for removal of openstack-cinder package @@ -198,9 +209,24 @@ outputs: when: - step|int == 0 - release == 'ocata' - - name: Stop openstack-cinder-volume - service: name=openstack-cinder-volume state=stopped enabled=no - when: + - when: - step|int == 1 - release == 'ocata' - cinder_volume_enabled|bool + block: + - name: Stop openstack-cinder-volume + service: + name: openstack-cinder-volume + state: stopped + enabled: no + - name: Unmount cinder NFS shares mounted on the host + mount: + path: "{{ item.mount }}" + state: unmounted + loop: "{{ ansible_mounts }}" + loop_control: + label: "{{ item.mount }}" + index_var: cinder_mount_index + when: + - "'/var/lib/cinder/' in item.mount" + - "'nfs' in item.fstype" diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index 069d648f3c..40dddc1b62 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -321,6 +321,17 @@ outputs: until: output.rc == 0 - name: Disable cinder_volume service from boot service: name=openstack-cinder-volume enabled=no + - name: Unmount cinder NFS shares mounted on the host + mount: + path: "{{ item.mount }}" + state: unmounted + loop: "{{ ansible_mounts }}" + loop_control: + label: "{{ item.mount }}" + index_var: cinder_mount_index + when: + - "'/var/lib/cinder/' in item.mount" + - "'nfs' in item.fstype" - name: Update cinder_volume pcs resource bundle for new container image when: - step|int == 1 @@ -384,3 +395,16 @@ outputs: - release == 'ocata' - is_bootstrap_node|bool - cinder_volume_res|bool + - name: Unmount cinder NFS shares mounted on the host + mount: + path: "{{ item.mount }}" + state: unmounted + loop: "{{ ansible_mounts }}" + loop_control: + label: "{{ item.mount }}" + index_var: cinder_mount_index + when: + - step|int == 2 + - release == 'ocata' + - "'/var/lib/cinder/' in item.mount" + - "'nfs' in item.fstype"