Commit c2a3424b authored by Thomas Schneider's avatar Thomas Schneider

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

parent 6cbf8c79
...@@ -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,40 +91,74 @@ ...@@ -91,40 +91,74 @@
- nfs-client - nfs-client
- service - service
- name: ensure there is a base directory for automount - name: Configure automount
file: state=directory path=/net owner=root group=root mode=0755 when: automount
notify: block:
- restart autofs - name: ensure there is a base directory for automount
tags: file: state=directory path=/net owner=root group=root mode=0755
- nfs-client notify:
- restart autofs
- name: ensure automounter is configured tags:
copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644 - nfs-client
notify:
- restart autofs - name: ensure automounter is configured
tags: copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644
- nfs-client notify:
- config - restart autofs
tags:
- name: ensure mounts from central storage are available - nfs-client
template: src=auto.nfs.j2 dest=/etc/auto.nfs owner=root group=root mode=0644 - config
notify:
- restart autofs - name: ensure mounts from central storage are available
tags: template: src=auto.nfs.j2 dest=/etc/auto.nfs owner=root group=root mode=0644
- nfs-client notify:
- config - restart autofs
tags:
- name: ensure automounter is enabled - nfs-client
service: name=autofs state=running enabled=yes - config
tags:
- nfs-client - name: ensure automounter is enabled
- service service: name=autofs state=running enabled=yes
tags:
- name: ensure linking of netdirs - nfs-client
file: src="/net/{{ item.netdir }}" dest="/{{ item.dest }}" state=link force=yes - service
with_items: "{{ nfs_shares }}"
tags: - name: ensure linking of netdirs
- nfs-client file: src="/net/{{ item.netdir }}" dest="/{{ item.dest }}" state=link force=yes
with_items: "{{ nfs_shares }}"
tags:
- 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment