Skip to content
Snippets Groups Projects
Commit f9e9f5ca authored by Chris Hines's avatar Chris Hines
Browse files

fix up the NFS related tasks, so that the server definitly restarts after the...

fix up the NFS related tasks, so that the server definitly restarts after the exports are written and the mounting of filesystems on clients is correct
parent 118dfd07
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
service: name=fail2ban state=stopped service: name=fail2ban state=stopped
sudo: true sudo: true
- name: "Mounting NFS mounts" - name: "Mounting NFS mounts"
mount: name={{ item.mntpt }} src={{ item.src }} fstype={{ item.fstype }} opts={{ item.opts }} state=mounted mount: name={{ item.name }} src=" {{ item.ipv4 }}:{{ item.src }} " fstype={{ item.fstype }} opts={{ item.opts }} state=mounted
with_items: nfsMounts with_items: nfsMounts
notify: "restart authentication" notify: "restart authentication"
notify: "restart rpcbind" notify: "restart rpcbind"
......
...@@ -8,11 +8,15 @@ ...@@ -8,11 +8,15 @@
template: src=exports.j2 dest=/etc/exports owner=root group=root mode=644 template: src=exports.j2 dest=/etc/exports owner=root group=root mode=644
sudo: true sudo: true
# Do not do this as a handler, instead do this here as a task so that it happens imediatly after the exports file is created before any clients - name: "Start the Server"
# attempt a mount service: "name=nfs state=restarted"
- name : "Reload exports"
command: exportfs -ra
sudo: true sudo: true
when: ansible_os_family == "RedHat"
- name: "Start the Server"
service: "name=nfs-kernel-server state=restarted"
sudo: true
when: ansible_os_family == "Debian"
- name : "Pause ... clients sometimes have errors" - name : "Pause ... clients sometimes have errors"
command: sleep 60 command: sleep 60
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment