Ansible Role mount
This role installs NFS and CIFS client utilities when necessary and configures mount points in /etc/fstab
.
Optional Role Variables
Variable |
Description |
Default Value |
---|---|---|
|
List of directories containing the mounts to create. Subkeys:
|
|
Example:
# optional
mount__mounts__host_var:
- path: '/mnt/nfs/data'
fstype: 'nfs'
src: 'nfs-server.example.com:/path/to/exported/data'
opts: 'defaults'
state: 'mounted'
- path: '/mnt/cifs/data'
fstype: 'cifs'
src: '//cifs-server.example.com/CIFS-Share'
opts: 'username=USERNAME,password=PASSWORD,vers=2.0,rw'
state: 'mounted'
- path: '/data'
fstype: 'xfs'
src: '/dev/sdb1'
opts: 'defaults'
state: 'mounted'
Troubleshooting
mount.nfs: access denied by server while mounting
: Run exportfs -rv
on the NFS server and try again.