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

Safe HaskellNone




When propellor runs on a Host, it ensures that its Properties are satisfied, taking action as necessary when a Property is not currently satisfied.

A simple propellor program example:

import Propellor
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt

main :: IO ()
main = defaultMain hosts

hosts :: [Host]
hosts =
  [ host ""
    & Apt.installed ["mydaemon"]
    & "/etc/mydaemon.conf" `File.containsLine` "secure=1"
      `onChange` cmdProperty "service" ["mydaemon", "restart"]
    ! Apt.installed ["unwantedpackage"]

See config.hs for a more complete example, and clone Propellor's git repository for a deployable system using Propellor: git clone git://


Core data types

data Host Source

Everything Propellor knows about a system: Its hostname, properties and their collected info.



data Property i Source

The core data type of Propellor, this represents a property that the system should have, and an action to ensure it has the property.

A property can have associated Info or not. This is tracked at the type level with Property NoInfo and Property HasInfo.

There are many instances and type families, which are mostly used internally, so you needn't worry about them.

(<!>) :: Property i1 -> Property i2 -> RevertableProperty Source

Shorthand to construct a revertable property.

Config file

defaultMain :: [Host] -> IO () Source

Runs propellor on hosts, as controlled by command-line options.

host :: HostName -> Host Source

Starts accumulating the properties of a Host.

host ""
	& someproperty
	! oldproperty
	& otherproperty

(&) :: (PropAccum h, IsProp p) => h -> p -> h infixl 1 Source

Adds a property to a Host or other PropAccum

Can add Properties and RevertableProperties

(!) :: PropAccum h => h -> RevertableProperty -> h infixl 1 Source

Adds a property in reverted form.


describe :: IsProp p => p -> Desc -> p Source

Changes the description of a property.

Properties are often combined together in your propellor configuration. For example:

"/etc/foo/config" `File.containsLine` "bar=1"
	`requires` File.dirExists "/etc/foo"

requires :: Combines x y => x -> y -> CombinedType x y Source

Indicates that the first property depends on the second, so before the first is ensured, the second must be ensured.

before :: (IsProp x, Combines y x, IsProp (CombinedType y x)) => x -> y -> CombinedType y x Source

Combines together two properties, resulting in one property that ensures the first, and if the first succeeds, ensures the second.

The combined property uses the description of the first property.

onChange :: Combines (Property x) (Property y) => Property x -> Property y -> CombinedType (Property x) (Property y) Source

Whenever a change has to be made for a Property, causes a hook Property to also be run, but not otherwise.

Everything you need to build your own properties, and useful property combinators

Properties to run shell commands

Properties that set Info

Combining a list of properties into a single property

Private data access for properties