Installs and configures autofs.
# Ansible version 1.4.4+
ansible --version
# OS
case $OSTYPE in
# Linux needs apt|yum|dnf|zypper
"linux"*)
apt --version||yum --version||dnf --version||zypper --version;;
# OS X needs nothing
"darwin"*)
echo autofs is OOB;;
esac
# --- autofs config ---
autofs_indirect_maps:
- name: autofs.nfs
path: /mnt/nfs
mounts:
- name: "isos"
fstype: "nfs,rw,bg,hard,intr,tcp,resvport"
url: "nfs.server.com:/data/isos"
# --- OS setup ---
# Shouldn't need to modify
autofs_pkgs:
Linux: [ 'autofs' ]
Darwin: []
# --- OS config ---
# Shouldn't need to modify
autofs_master:
Linux: "/etc/auto.master"
Darwin: "/etc/auto_master"
None.
- name: "Media Client"
hosts: clients.media
roles:
- name: "Media Client | NFS | ensure automounts"
sudo: yes
role: cmprescott.autofs
autofs_indirect_maps:
- name: "auto.nfs"
path: "/mnt/nfs"
mounts:
- name: "movies"
fstype: "nfs,rw,bg,hard,intr,tcp,resvport"
url: "nfs.server.com:/data/movies"
- name: "tv"
fstype: "nfs,rw,bg,hard,intr,tcp,resvport"
url: "nfs.server.com:/data/tv"
BSD
Prescott Chris