PARALLAX

mount

Manage filesystem mounts and their fstab entries

Collection: posix

Full Name: parallax.posix.mount

Aliases: ansible.posix.mount

Synopsis

Manage filesystem mounts and their fstab entries

Parameters

NameTypeRequiredDefaultDescription
pathstringyesMount point path (required)
srcstringDevice or source to mount
fstypestringFilesystem type (e.g., ext4, xfs, nfs)
optsstringdefaultsMount options (comma-separated)
statestringmountedDesired state Choices: mounted, unmounted, present, absent, remounted
fstabstring/etc/fstabPath to fstab file
bootbooltrueWhether the filesystem should be mounted at boot
backupboolfalseCreate a backup of fstab before modifying
dumpstring0Dump field value for fstab entry
passnostring0Pass number field for fstab entry

Example

yaml
- name: Mount an NFS share at boot
  ansible.posix.mount:
    path: /mnt/shared
    src: nfs1.internal:/export/shared
    fstype: nfs
    opts: ro,soft
    state: mounted
Search
    ↑ ↓ move↵ openesc close