Skip to content
Snippets Groups Projects
Commit c2a3424b authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Use autofs iff it is configured for a host, else fstab

parent 6cbf8c79
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
- name: restart autofs - name: restart autofs
service: name=autofs state=restarted service: name=autofs state=restarted
when: automount
- name: restart nfs-client - name: restart nfs-client
service: name=nfs-client.target state=restarted service: name=nfs-client.target state=restarted
......
...@@ -91,6 +91,9 @@ ...@@ -91,6 +91,9 @@
- nfs-client - nfs-client
- service - service
- name: Configure automount
when: automount
block:
- name: ensure there is a base directory for automount - name: ensure there is a base directory for automount
file: state=directory path=/net owner=root group=root mode=0755 file: state=directory path=/net owner=root group=root mode=0755
notify: notify:
...@@ -126,6 +129,37 @@ ...@@ -126,6 +129,37 @@
tags: tags:
- nfs-client - nfs-client
- name: Configure fstab nfs mounts
when: not automount
block:
- name: Disable automounter
service:
name: autofs
state: stopped
enabled: no
tags:
- nfs-client
- service
- name: Ensure mountpoints are directories
file:
path: "/{{item.dest}}"
state: directory
with_items: "{{nfs_shares}}"
tags:
- nfs-client
- name: Create fstab entries
mount:
fstype: "nfs"
src: "{{item.src}}"
path: "/{{item.dest}}"
opts: "{{item.options}}"
state: mounted
with_items: "{{nfs_shares}}"
tags:
- nfs-client
- name: configure default umask and other user related stuff - name: configure default umask and other user related stuff
copy: src=login.defs dest=/etc/login.defs owner=root group=root mode=0644 copy: src=login.defs dest=/etc/login.defs owner=root group=root mode=0644
tags: tags:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment