From 32550c88bc7915502b1825de27100ea0e987d5ce Mon Sep 17 00:00:00 2001 From: Chris Hines <chris.hines@monash.edu> Date: Thu, 21 Jul 2016 05:46:31 +0000 Subject: [PATCH] Removed 1) attempts in nfs-client to notify two handlers at once (this didn't work) 2) attempts to mount a file system twice (I don't know why we included this in the first place, mounts should work first time) 3) checks using mountpoint -q (this a) didn't work when updating a mount b) only checked the first mount) Former-commit-id: 75e7357b8d0557088a9fa131135dc3c9b86be64f --- roles/nfs-client/tasks/mountFileSystem.yml | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/roles/nfs-client/tasks/mountFileSystem.yml b/roles/nfs-client/tasks/mountFileSystem.yml index 76506d50..80d53d35 100644 --- a/roles/nfs-client/tasks/mountFileSystem.yml +++ b/roles/nfs-client/tasks/mountFileSystem.yml @@ -1,38 +1,9 @@ --- -- name: "stop fail2ban" - service: name=fail2ban state=stopped - sudo: true - -- name: "Check NFS mount, it may not be necessary, just in case if the following role does actively re-mount" - shell: mountpoint -q {{ nfsMounts[0].name }} - register: mount_state - ignore_errors: true - when: nfsMounts is defined - name: "Mounting NFS mounts" mount: name={{ item.name }} src="{{ item.ipv4 }}:{{ item.src }}" fstype={{ item.fstype }} opts={{ item.opts }} state=mounted with_items: "{{ nfsMounts }}" - notify: "restart rpcbind" - notify: "restart idmap" sudo: true ignore_errors: true register: firstMount - when: nfsMounts is defined and mount_state | failed - -- name: "Wait for nfs to stabailse" - command: sleep 60 - delegate_to: 127.0.0.1 - when: firstMount | failed - -- name: "Mounting NFS mounts after failure" - mount: name={{ item.name }} src="{{ item.ipv4 }}:{{ item.src }}" fstype={{ item.fstype }} opts={{ item.opts }} state=mounted - with_items: "{{ nfsMounts }}" - notify: "restart idmap" - notify: "restart rpcbind" - sudo: true - when: nfsMounts is defined and firstMount is defined and firstMount | failed - -- name: "restart fail2ban" - service: name=fail2ban state=started - sudo: true - + when: nfsMounts is defined -- GitLab