Mount any type of mountable filesystem with the mounted function:
/mnt/sdb: mount.mounted: - device: /dev/sdb1 - fstype: ext4 - mkmnt: True - opts: - defaults /srv/bigdata: mount.mounted: - device: UUID=066e0200-2867-4ebe-b9e6-f30026ca2314 - fstype: xfs - opts: nobootwait,noatime,nodiratime,nobarrier,logbufs=8 - dump: 0 - pass_num: 2 - persist: True - mkmnt: True
mod_watch(name, user=None, **kwargs)¶
The mounted watcher, called to invoke the watch command.
mounted(name, device, fstype, mkmnt=False, opts='defaults', dump=0, pass_num=0, config='/etc/fstab', persist=True, mount=True, user=None, match_on='auto', extra_mount_invisible_options=None, extra_mount_invisible_keys=None, extra_mount_ignore_fs_keys=None, extra_mount_translate_options=None, hidden_opts=None)¶
Verify that a device is mounted
ext2/3/4in the case of classic filesystems, and
fusein the case of fuse mounts
mkmnt: Trueto create the mount point if it is otherwise not present
auto, a special value indicating to guess based on fstype. In general,
automatches on name for recognized special devices and device otherwise.
A list of extra key options that are not visible through the /proc/self/mountinfo interface. If a key option is not visible through this interface it will always remount the device. This Option extends the builtin mount_invisible_keys list. A good example for a key Option is the password Option:
A dict of filesystem options which should not force a remount. This will update the internal dictionary. The dict should look like this:
- 'ramfs': ['size']
A dict of mount options that gets translated when mounted. To prevent a remount add additional Options to the default dictionary. This will update the internal dictionary. The dictionary should look like this:
- 'tcp': 'proto=tcp', 'udp': 'proto=udp'
A list of mount options that will be ignored when considering a remount as part of the state application
swap(name, persist=True, config='/etc/fstab')¶
Activates a swap device
swap does not currently support LABEL
unmounted(name, device=None, config='/etc/fstab', persist=False, user=None)¶
Verify that a device is not mounted
The device to be unmounted. This is optional because the device could be mounted in multiple places.