propellor-5.7.0: property-based host configuration management in haskell

Safe HaskellNone
LanguageHaskell98

Propellor.Property.Fstab

Synopsis

Documentation

type FsType = String Source #

type of filesystem to mount ("auto" to autodetect)

type Source = String Source #

A device or other thing to be mounted.

type MountPoint = FilePath Source #

A mount point for a filesystem.

newtype MountOpts Source #

Filesystem mount options. Eg, MountOpts ["errors=remount-ro"]

For default mount options, use mempty.

Constructors

MountOpts [String] 

mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property Linux Source #

Ensures that /etc/fstab contains a line mounting the specified Source on the specified MountPoint, and that it's currently mounted.

For example:

mounted "auto" "/dev/sdb1" "/srv" mempty

Note that if anything else is already mounted at the MountPoint, it will be left as-is by this property.

listed :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike Source #

Ensures that /etc/fstab contains a line mounting the specified Source on the specified MountPoint. Does not ensure that it's currently mounted.

swap :: Source -> Property Linux Source #

Ensures that /etc/fstab contains a line enabling the specified Source to be used as swap space, and that it's enabled.

fstabbed :: [MountPoint] -> [SwapPartition] -> Property Linux Source #

Replaces /etc/fstab with a file that should cause the currently mounted partitions to be re-mounted the same way on boot.

For each specified MountPoint, the UUID of each partition (or if there is no UUID, its label), its filesystem type, and its mount options are all automatically probed.

The SwapPartitions are also included in the generated fstab.

noFstab :: IO Bool Source #

Checks if /etc/fstab is not configured. This is the case if it doesn't exist, or consists entirely of blank lines or comments.

So, if you want to only replace the fstab once, and then never touch it again, allowing local modifications:

check noFstab (fstabbed mnts [])