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

Safe HaskellNone




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, "errors=remount-ro"


MountOpts [String] 

bindMount :: FilePath -> FilePath -> Property NoInfo Source

Bind mounts the first directory so its contents also appear in the second directory.

fstabbed :: [MountPoint] -> [SwapPartition] -> Property NoInfo 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 [])

mountPoints :: IO [MountPoint] Source

Lists all mount points of the system.

mountPointsBelow :: FilePath -> IO [MountPoint] Source

Finds all filesystems mounted inside the specified directory.

getFsType :: MountPoint -> IO (Maybe FsType) Source

Filesystem type mounted at a given location.

getFsMountOpts :: MountPoint -> IO MountOpts Source

Mount options for the filesystem mounted at a given location.

getMountUUID :: MountPoint -> IO (Maybe UUID) Source

UUID of filesystem mounted at a given location.

getSourceUUID :: Source -> IO (Maybe UUID) Source

UUID of a device

getMountLabel :: MountPoint -> IO (Maybe Label) Source

Label of filesystem mounted at a given location.

getSourceLabel :: Source -> IO (Maybe UUID) Source

Label of a device

getMountSource :: MountPoint -> IO (Maybe Source) Source

Device mounted at a given location.

umountLazy :: FilePath -> IO () Source

Unmounts a device or mountpoint, lazily so any running processes don't block it.

unmountBelow :: FilePath -> IO () Source

Unmounts anything mounted inside the specified directory.