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 @@
- name: restart autofs
service: name=autofs state=restarted
when: automount
- name: restart nfs-client
service: name=nfs-client.target state=restarted
......
......@@ -91,40 +91,74 @@
- nfs-client
- service
- name: ensure there is a base directory for automount
file: state=directory path=/net owner=root group=root mode=0755
notify:
- restart autofs
tags:
- nfs-client
- name: ensure automounter is configured
copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644
notify:
- restart autofs
tags:
- nfs-client
- config
- name: ensure mounts from central storage are available
template: src=auto.nfs.j2 dest=/etc/auto.nfs owner=root group=root mode=0644
notify:
- restart autofs
tags:
- nfs-client
- config
- name: ensure automounter is enabled
service: name=autofs state=running enabled=yes
tags:
- nfs-client
- service
- name: ensure linking of netdirs
file: src="/net/{{ item.netdir }}" dest="/{{ item.dest }}" state=link force=yes
with_items: "{{ nfs_shares }}"
tags:
- nfs-client
- name: Configure automount
when: automount
block:
- name: ensure there is a base directory for automount
file: state=directory path=/net owner=root group=root mode=0755
notify:
- restart autofs
tags:
- nfs-client
- name: ensure automounter is configured
copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644
notify:
- restart autofs
tags:
- nfs-client
- config
- name: ensure mounts from central storage are available
template: src=auto.nfs.j2 dest=/etc/auto.nfs owner=root group=root mode=0644
notify:
- restart autofs
tags:
- nfs-client
- config
- name: ensure automounter is enabled
service: name=autofs state=running enabled=yes
tags:
- nfs-client
- service
- name: ensure linking of netdirs
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
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