mount – Control active and configured mount points
mount – Control active and configured mount points
Synopsis
- This module controls active and configured mount points in
/etc/fstab
.
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
backup boolean added in 2.5 |
|
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. |
boot boolean added in 2.2 |
|
Determines if the filesystem should be mounted on boot. Only applies to Solaris systems. |
dump - |
Default: 0 |
Dump (see fstab(5)). Note that if set to Has no effect on Solaris systems. |
fstab - |
Default: "/etc/fstab (/etc/vfstab on Solaris)" |
File to use instead of |
fstype - |
Filesystem type. Required when state is | |
opts - |
Mount options (see fstab(5), or vfstab(4) on Solaris). | |
passno - |
Default: 0 |
Passno (see fstab(5)). Note that if set to Deprecated on Solaris systems. |
path - / required |
Path to the mount point (e.g. Before 2.3 this option was only usable as dest, destfile and name.
| |
src - |
Device to be mounted on path. Required when state set to | |
state - / required |
|
If If
|
Notes
Note
- As of Ansible 2.3, the name option has been changed to path as default, but name still works as well.
Examples
# Before 2.3, option 'name' was used instead of 'path'
- name: Mount DVD read-only
mount:
path: /mnt/dvd
src: /dev/sr0
fstype: iso9660
opts: ro,noauto
state: present
- name: Mount up device by label
mount:
path: /srv/disk
src: LABEL=SOME_LABEL
fstype: ext4
state: present
- name: Mount up device by UUID
mount:
path: /home
src: UUID=b3e48f45-f933-4c8e-a700-22a159ec9077
fstype: xfs
opts: noatime
state: present
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Core Team. [core]
Red Hat Support
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors
- Ansible Core Team
- Seth Vidal
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/mount_module.html