summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2017-06-01 10:47:20 -0500
committerJose A. Rivera <jarrpa@redhat.com>2017-06-13 13:10:23 -0500
commitddc472dbb4a54e15f07f6d947bda943a9a919da6 (patch)
tree5d0ea3a86db1d768b025ebfe80b4845ec1909e1a
parent73820278c8c1ca1bc83e1c69f4939c0a48d88e46 (diff)
downloadopenshift-ddc472dbb4a54e15f07f6d947bda943a9a919da6.tar.gz
openshift-ddc472dbb4a54e15f07f6d947bda943a9a919da6.tar.bz2
openshift-ddc472dbb4a54e15f07f6d947bda943a9a919da6.tar.xz
openshift-ddc472dbb4a54e15f07f6d947bda943a9a919da6.zip
GlusterFS: Fix bugs in wipe
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
-rw-r--r--roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml6
-rw-r--r--roles/openshift_storage_glusterfs/tasks/glusterfs_deploy.yml9
2 files changed, 10 insertions, 5 deletions
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
index 17b1eeb89..8cb780507 100644
--- a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
+++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
@@ -5,9 +5,6 @@
name: "{{ glusterfs_namespace }}"
when: glusterfs_is_native or glusterfs_heketi_is_native
-- include: glusterfs_deploy.yml
- when: glusterfs_is_native
-
- name: Make sure heketi-client is installed
package: name=heketi-client state=present
when: not openshift.common.is_atomic | bool
@@ -63,6 +60,9 @@
retries: "{{ (glusterfs_timeout | int / 10) | int }}"
when: glusterfs_heketi_wipe
+- include: glusterfs_deploy.yml
+ when: glusterfs_is_native
+
- name: Create heketi service account
oc_serviceaccount:
namespace: "{{ glusterfs_namespace }}"
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_deploy.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_deploy.yml
index bb831147d..ea4dcc510 100644
--- a/roles/openshift_storage_glusterfs/tasks/glusterfs_deploy.yml
+++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_deploy.yml
@@ -41,11 +41,16 @@
failed_when: False
when: glusterfs_wipe
- # Runs "vgremove -fy <vg>; pvremove -fy <pv>" for every device found to be a physical volume.
+ # Runs "lvremove -ff <vg>; vgremove -fy <vg>; pvremove -fy <pv>" for every device found to be a physical volume.
- name: Clear GlusterFS storage device contents
- shell: "{% for line in item.stdout_lines %}{% set fields = line.split() %}{% if fields | count > 1 %}vgremove -fy {{ fields[1] }}; {% endif %}pvremove -fy {{ fields[0] }}; {% endfor %}"
+ shell: "{% for line in item.stdout_lines %}{% set fields = line.split() %}{% if fields | count > 1 %}lvremove -ff {{ fields[1] }}; vgremove -fy {{ fields[1] }}; {% endif %}pvremove -fy {{ fields[0] }}; {% endfor %}"
delegate_to: "{{ item.item }}"
with_items: "{{ devices_info.results }}"
+ register: clear_devices
+ until:
+ - "'contains a filesystem in use' not in clear_devices.stderr"
+ delay: 1
+ retries: 30
when:
- glusterfs_wipe
- item.stdout_lines | count > 0