diff --git a/roles/nfs-client/tasks/mountFileSystem.yml b/roles/nfs-client/tasks/mountFileSystem.yml index 76506d50b7aca86aade2223e878aa49dde71c8f3..80d53d356deaace73a106d551aacc32b54adbac6 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