Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Host = Host {}
- type Desc = String
- data Property i
- data HasInfo
- data NoInfo
- type family CInfo x y
- infoProperty :: Desc -> Propellor Result -> Info -> [Property i] -> Property HasInfo
- simpleProperty :: Desc -> Propellor Result -> [Property NoInfo] -> Property NoInfo
- adjustPropertySatisfy :: Property i -> (Propellor Result -> Propellor Result) -> Property i
- propertyInfo :: Property i -> Info
- propertyDesc :: Property i -> Desc
- propertyChildren :: Property i -> [Property i]
- data RevertableProperty = RevertableProperty (Property HasInfo) (Property HasInfo)
- (<!>) :: Property i1 -> Property i2 -> RevertableProperty
- class IsProp p where
- class Combines x y where
- requires :: x -> y -> CombinedType x y
- type family CombinedType x y
- before :: (IsProp x, Combines y x, IsProp (CombinedType y x)) => x -> y -> CombinedType y x
- combineWith :: Combines (Property x) (Property y) => (Propellor Result -> Propellor Result -> Propellor Result) -> Property x -> Property y -> CombinedType (Property x) (Property y)
- data Info = Info {}
- newtype Propellor p = Propellor {
- runWithHost :: RWST Host [EndAction] () IO p
- data EndAction = EndAction Desc (Result -> Propellor Result)
- module Propellor.Types.OS
- module Propellor.Types.Dns
- module Propellor.Types.Result
- propertySatisfy :: Property i -> Propellor Result
- ignoreInfo :: Property i -> Property NoInfo
Documentation
Everything Propellor knows about a system: Its hostname, properties and their collected info.
The core data type of Propellor, this represents a property that the system should have, and an action to ensure it has the property.
Combines RevertableProperty (Property NoInfo) | |
Combines RevertableProperty (Property HasInfo) | |
Show (Property i) | |
IsProp (Property NoInfo) | |
IsProp (Property HasInfo) | |
PropertyList [Property NoInfo] | |
PropertyList [Property HasInfo] | |
Combines (Property NoInfo) (Property NoInfo) | |
Combines (Property NoInfo) (Property HasInfo) | |
Combines (Property HasInfo) (Property NoInfo) | |
Combines (Property HasInfo) (Property HasInfo) | |
type CombinedType RevertableProperty (Property NoInfo) = RevertableProperty | |
type CombinedType RevertableProperty (Property HasInfo) = RevertableProperty | |
type PropertyListType [Property NoInfo] = NoInfo | |
type PropertyListType [Property HasInfo] = HasInfo | |
type CombinedType (Property x) (Property y) = Property (CInfo x y) |
Indicates that a Property has associated Info.
Combines RevertableProperty (Property HasInfo) | |
IsProp (Property HasInfo) | |
PropertyList [Property HasInfo] | |
Combines (Property NoInfo) (Property HasInfo) | |
Combines (Property HasInfo) (Property NoInfo) | |
Combines (Property HasInfo) (Property HasInfo) | |
type CInfo NoInfo HasInfo = HasInfo | |
type CInfo HasInfo NoInfo = HasInfo | |
type CInfo HasInfo HasInfo = HasInfo | |
type CombinedType RevertableProperty (Property HasInfo) = RevertableProperty | |
type PropertyListType [Property HasInfo] = HasInfo |
Indicates that a Property does not have Info.
Combines RevertableProperty (Property NoInfo) | |
IsProp (Property NoInfo) | |
PropertyList [Property NoInfo] | |
Combines (Property NoInfo) (Property NoInfo) | |
Combines (Property NoInfo) (Property HasInfo) | |
Combines (Property HasInfo) (Property NoInfo) | |
type CInfo NoInfo NoInfo = NoInfo | |
type CInfo NoInfo HasInfo = HasInfo | |
type CInfo HasInfo NoInfo = HasInfo | |
type CombinedType RevertableProperty (Property NoInfo) = RevertableProperty | |
type PropertyListType [Property NoInfo] = NoInfo |
Type level calculation of the combination of HasInfo and/or NoInfo
:: Desc | description of the property |
-> Propellor Result | action to run to satisfy the property (must be idempotent; may run repeatedly) |
-> Info | info associated with the property |
-> [Property i] | child properties |
-> Property HasInfo |
Constructs a Property with associated Info.
simpleProperty :: Desc -> Propellor Result -> [Property NoInfo] -> Property NoInfo Source
Constructs a Property with no Info.
adjustPropertySatisfy :: Property i -> (Propellor Result -> Propellor Result) -> Property i Source
Changes the action that is performed to satisfy a property.
propertyInfo :: Property i -> Info Source
propertyDesc :: Property i -> Desc Source
propertyChildren :: Property i -> [Property i] Source
A Property can include a list of child properties that it also satisfies. This allows them to be introspected to collect their info, etc.
data RevertableProperty Source
A property that can be reverted.
(<!>) :: Property i1 -> Property i2 -> RevertableProperty Source
Makes a revertable property; the first Property is run normally and the second is run when it's reverted.
class Combines x y where Source
requires :: x -> y -> CombinedType x y Source
Indicates that the first property depends on the second, so before the first is ensured, the second will be ensured.
type family CombinedType x y Source
Type level calculation of the type that results from combining two types
with requires
.
type CombinedType RevertableProperty RevertableProperty = RevertableProperty | |
type CombinedType RevertableProperty (Property NoInfo) = RevertableProperty | |
type CombinedType RevertableProperty (Property HasInfo) = RevertableProperty | |
type CombinedType (Property x) (Property y) = Property (CInfo x y) |
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 property uses the description of the first property.
combineWith :: Combines (Property x) (Property y) => (Propellor Result -> Propellor Result -> Propellor Result) -> Property x -> Property y -> CombinedType (Property x) (Property y) Source
Combines together two properties, yielding a property that has the description and info of the first, and that has the second property as a child. The two actions to satisfy the properties are passed to a function that can combine them in arbitrary ways.
Information about a host.
Info | |
|
Propellor's monad provides read-only access to info about the host it's running on, and a writer to accumulate EndActions.
An action that Propellor runs at the end, after trying to satisfy all properties. It's passed the combined Result of the entire Propellor run.
module Propellor.Types.OS
module Propellor.Types.Dns
module Propellor.Types.Result
propertySatisfy :: Property i -> Propellor Result Source
Gets the action that can be run to satisfy a Property.
You should never run this action directly. Use
ensureProperty
instead.
ignoreInfo :: Property i -> Property NoInfo Source
Makes a version of a Proprty without its Info. Use with caution!