diff --git a/nfs-client/files/auto.master b/nfs-client/files/auto.master new file mode 100644 index 0000000000000000000000000000000000000000..aef7888b76e0fd5d8292e0f4dea827125e370cc2 --- /dev/null +++ b/nfs-client/files/auto.master @@ -0,0 +1,24 @@ +# +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +# +#/misc /etc/auto.misc +# +# NOTE: mounts done from a hosts map will be mounted with the +# "nosuid" and "nodev" options unless the "suid" and "dev" +# options are explicitly given. +# +#/net -hosts +/net /etc/auto.nfs +# +# Include central master map if it can be found using +# nsswitch sources. +# +# Note that if there are entries for /net or /misc (as +# above) in the included master map any keys that are the +# same will not be seen as the first read key seen takes +# precedence. +# ++auto.master diff --git a/nfs-client/files/create_netdir.sh b/nfs-client/files/create_netdir.sh new file mode 100644 index 0000000000000000000000000000000000000000..b2f75521bf4eff05eaf33af7d2f472f8b1896e64 --- /dev/null +++ b/nfs-client/files/create_netdir.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ ! -h /$1 ]; then + rm /$1 + rmdir /$1 + ln -s /net/$1 /$1 +fi + diff --git a/nfs-client/handlers/main.yml b/nfs-client/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..b6756c0545d70cee2f911e2611d67ad2f9274cfc --- /dev/null +++ b/nfs-client/handlers/main.yml @@ -0,0 +1,5 @@ +--- +# file: roles/nfs-client/handlers/main.yml + +- name: restart autofs + service: name=autofs state=restarted diff --git a/nfs-client/tasks/main.yml b/nfs-client/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e7827557096870ba77fb5bddaa96bee6cbe0f6ab --- /dev/null +++ b/nfs-client/tasks/main.yml @@ -0,0 +1,35 @@ +--- +# file: roles/nfs-client/tasks/main.yml + +- name: ensure nfs client utils are installed + apt: name=nfs-common state=latest + tags: nfs-client packages + +- name: ensure CIFS utils are installed + apt: name=cifs-utils,smbclient state=latest + tags: cifs-client packages + +# makes life much easier to have an automounter and not /etc/fstab +- name: ensure automounter is installed + apt: name=autofs state=latest + tags: autofs packages + +- name: ensure automounter is configured + copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644 + notify: + - restart autofs + tags: autofs 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: autofs config + +- name: ensure linking of home + script: create_netdir.sh home + tags: fsmpi + +- name: ensure linking of pub + script: create_netdir.sh pub + tags: fsmpi diff --git a/nfs-client/templates/auto.nfs.j2 b/nfs-client/templates/auto.nfs.j2 new file mode 100644 index 0000000000000000000000000000000000000000..65e3ce7b13cc6009be862066c60d4d2cf85d6e5c --- /dev/null +++ b/nfs-client/templates/auto.nfs.j2 @@ -0,0 +1,7 @@ +## TODO +home -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 rumo.fsmpi.rwth-aachen.de:/DATA/home +pub -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 rumo.fsmpi.rwth-aachen.de:/DATA/pub +eschrank -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 schrank.fsmpi.rwth-aachen.de:/srv/eschrank +#sharing -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 portal.fsmpi.rwth-aachen.de:/srv/sharing +videoag -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 videoag.fsmpi.rwth-aachen.de:/srv/videoag +videoag_raw -fstype=nfs,noatime,hard,intr,nodev,nosuid,vers=3 videoag.fsmpi.rwth-aachen.de:/srv/videoag_raw