mirror of
https://github.com/geerlingguy/ansible-role-nfs
synced 2024-12-11 19:50:18 +01:00
Use exportfs -ra instead of restarting the NFS service to avoid breaking already existing mounts
This commit is contained in:
parent
f2778aa96f
commit
8e7803392f
2 changed files with 3 additions and 10 deletions
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
- name: restart nfs
|
||||
service: "name={{ nfs_server_daemon }} state=restarted"
|
||||
when: nfs_exports|length
|
||||
- name: reload nfs
|
||||
command: 'exportfs -ra'
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
- name: Ensure directories to export exist
|
||||
file: 'path="{{ item.strip().split()[0] }}" state=directory'
|
||||
with_items: "{{ nfs_exports }}"
|
||||
notify: restart nfs
|
||||
|
||||
- name: Copy exports file.
|
||||
template:
|
||||
|
@ -30,12 +29,7 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
register: nfs_exports_copy
|
||||
notify: restart nfs
|
||||
|
||||
- name: Restart NFS immediately if exports are updated.
|
||||
service: "name={{ nfs_server_daemon }} state=restarted"
|
||||
when: nfs_exports_copy.changed
|
||||
notify: reload nfs
|
||||
|
||||
- name: Ensure nfs is running.
|
||||
service: "name={{ nfs_server_daemon }} state=started enabled=yes"
|
||||
|
|
Loading…
Reference in a new issue