From 77d705c123f911d6a5a49b398eb722af30288d7a Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Sat, 30 Dec 2017 12:36:28 +0100 Subject: [PATCH] Fixes #893. Check if the fs on the target device and mountpoint is present. Running this role on a node which already has a device mounted on the target mountpoint results in an error. This check makes the role to understand that everything is fine. --- roles/openshift-volume-quota/tasks/main.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/openshift-volume-quota/tasks/main.yaml b/roles/openshift-volume-quota/tasks/main.yaml index df58fe80b..a8c4c2e10 100644 --- a/roles/openshift-volume-quota/tasks/main.yaml +++ b/roles/openshift-volume-quota/tasks/main.yaml @@ -1,5 +1,10 @@ --- -- name: Create filesystem for /var/lib/origin/openshift.local.volumes +- name: Create filesystem for /var/lib/origin/openshift.local.volumes only if it's not present. + when: + - >- + ansible_mounts | json_query("[?device=='" + local_volumes_device + "']") | length == 0 + - >- + ansible_mounts | json_query("[?mount=='" + local_volumes_path + "']") | length == 0 filesystem: fstype: "{{ local_volumes_fstype }}" dev: "{{ local_volumes_device }}"