Install and configure autofs under Ubuntu

# install autofs package
apt-get install -y autofs

# create required directories
mkdir /etc/auto.master.d

# Configure NFS mount nas.example.com:/volume1/backup to /media/backup
echo "/media /etc/auto.media" >> /etc/auto.master.d/media.autofs
echo "backup -fstype=nfs,rw,async,vers=3 nas.example.com:/volume1/backup" >> /etc/auto.media

# check (directory will by created on access)
ll /media/backup

# debug
service autofs stop
sudo automount -f -v

Ansible playbook
https://github.com/panticz/ansible/blob/master/autofs-test.yml