Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Host = Host {}
- data Property i
- data Info
- data HasInfo
- data NoInfo
- type family CInfo x y
- type Desc = String
- 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 i = RevertableProperty (Property i) (Property i)
- class MkRevertableProperty i1 i2 where
- (<!>) :: Property i1 -> Property i2 -> RevertableProperty (CInfo i1 i2)
- class IsProp p where
- class Combines x y where
- combineWith :: ResultCombiner -> ResultCombiner -> x -> y -> CombinedType x y
- type family CombinedType x y
- type ResultCombiner = Propellor Result -> Propellor Result -> Propellor Result
- newtype Propellor p = Propellor {
- runWithHost :: RWST Host [EndAction] () IO p
- class LiftPropellor m where
- liftPropellor :: m a -> Propellor a
- 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.
Show Host Source | |
PropAccum Host Source | |
Conductable Host Source | |
MonadReader Host Propellor Source | |
Conductable [Host] Source | Each host in the list will be conducted in turn. Failure to conduct one host does not prevent conducting subsequent hosts in the list, but will be propagated as an overall failure of the property. |
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.
Information about a Host, which can be provided by its properties.
Indicates that a Property has associated Info.
Indicates that a Property does not have Info.
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 i Source
A property that can be reverted. The first Property is run normally and the second is run when it's reverted.
RevertableProperty (Property i) (Property i) |
class MkRevertableProperty i1 i2 where Source
Class of types that can be used as properties of a host.
class Combines x y where Source
:: ResultCombiner | How to combine the actions to satisfy the properties. |
-> ResultCombiner | Used when combining revertable properties, to combine their reversion actions. |
-> x | |
-> y | |
-> CombinedType x y |
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.
type family CombinedType x y Source
Type level calculation of the type that results from combining two types of properties.
type CombinedType (RevertableProperty x) (Property y) = Property (CInfo x y) Source | |
type CombinedType (RevertableProperty x) (RevertableProperty y) = RevertableProperty (CInfo x y) Source | |
type CombinedType (Property x) (RevertableProperty y) = Property (CInfo x y) Source | |
type CombinedType (Property x) (Property y) = Property (CInfo x y) Source |
Propellor's monad provides read-only access to info about the host it's running on, and a writer to accumulate EndActions.
class LiftPropellor m where Source
liftPropellor :: m a -> Propellor a Source
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!