.. _ansible.posix.mount_module:
*******************
ansible.posix.mount
*******************
**Control active and configured mount points**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module controls active and configured mount points in ``/etc/fstab``.
Parameters
----------
.. raw:: html
Parameter |
Choices/Defaults |
Comments |
backup
boolean
|
|
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
|
boot
boolean
|
|
Determines if the filesystem should be mounted on boot.
Only applies to Solaris and Linux systems.
For Solaris systems, true will set yes as the value of mount at boot in /etc/vfstab.
For Linux, FreeBSD, NetBSD and OpenBSD systems, false will add noauto to mount options in /etc/fstab.
To avoid mount option conflicts, if noauto specified in opts , mount module will ignore boot .
|
dump
string
|
Default:
0
|
Dump (see fstab(5)).
Note that if set to null and state set to present , it will cease to work and duplicate entries will be made with subsequent runs.
Has no effect on Solaris systems.
|
fstab
string
|
|
File to use instead of /etc/fstab .
You should not use this option unless you really know what you are doing.
This might be useful if you need to configure mountpoints in a chroot environment.
OpenBSD does not allow specifying alternate fstab files with mount so do not use this on OpenBSD with any state that operates on the live filesystem.
This parameter defaults to /etc/fstab or /etc/vfstab on Solaris.
|
fstype
string
|
|
Filesystem type.
Required when state is present or mounted .
|
opts
string
|
|
Mount options (see fstab(5), or vfstab(4) on Solaris).
|
passno
string
|
Default:
0
|
Passno (see fstab(5)).
Note that if set to null and state set to present , it will cease to work and duplicate entries will be made with subsequent runs.
Deprecated on Solaris systems.
|
path
path
/ required
|
|
Path to the mount point (e.g. /mnt/files ).
Before Ansible 2.3 this option was only usable as dest, destfile and name.
aliases: name
|
src
path
|
|
Device (or NFS volume, or something else) to be mounted on path.
Required when state set to present or mounted .
|
state
string
/ required
|
Choices:
- absent
- mounted
- present
- unmounted
- remounted
|
If mounted , the device will be actively mounted and appropriately configured in fstab. If the mount point is not present, the mount point will be created.
If unmounted , the device will be unmounted without changing fstab.
present only specifies that the device is to be configured in fstab and does not trigger or require a mount.
absent specifies that the device mount's entry will be removed from fstab and will also unmount the device and remove the mount point.
remounted specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If opts is set, the options will be applied to the remount, but will not change fstab. Additionally, if opts is set, and the remount command fails, the module will error to prevent unexpected mount changes. Try using mounted instead to work around this issue.
|