From 822694e790102efa2a5bb4a0c3d62c6fce1d4e87 Mon Sep 17 00:00:00 2001 From: Evan Cofsky Date: Fri, 26 Feb 2016 10:20:21 -0600 Subject: FreeBSD Support including: - Propellor bootstrapping - Basic pkg - Basic ZFS datasets and properties - Simple Poudriere configuration (regular and ZFS) - Poudriere jail creation FIXME: - Cron.hs: runPropellor needs the System, but hasn't yet gotten it. Reorganizing: - Remove FreeBSD.Process - Move ZFS up to Property - Add Info for Pkg.update/Pkg.upgrade - Move FreeBSD.md to doc so it'll show up automatically. - Merge the FreeBSD config with the other sample config. - Use Info to check Pkg updated/upgraded and Poudriere configured. - Warnings clean-up, move ZFS types to Propellor.Types. - Maintainer and license statements. --- src/Propellor/Types.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/Propellor/Types.hs') diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index f224c8ba..542a1f66 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -34,6 +34,7 @@ module Propellor.Types , module Propellor.Types.OS , module Propellor.Types.Dns , module Propellor.Types.Result + , module Propellor.Types.ZFS , propertySatisfy , ignoreInfo ) where @@ -49,6 +50,7 @@ import Propellor.Types.Info import Propellor.Types.OS import Propellor.Types.Dns import Propellor.Types.Result +import Propellor.Types.ZFS -- | Everything Propellor knows about a system: Its hostname, -- properties and their collected info. @@ -126,7 +128,7 @@ type instance CInfo NoInfo HasInfo = HasInfo type instance CInfo NoInfo NoInfo = NoInfo -- | Constructs a Property with associated Info. -infoProperty +infoProperty :: 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 @@ -158,7 +160,7 @@ propertySatisfy :: Property i -> Propellor Result propertySatisfy (IProperty _ a _ _) = a propertySatisfy (SProperty _ a _) = a --- | Changes the action that is performed to satisfy a property. +-- | Changes the action that is performed to satisfy a property. adjustPropertySatisfy :: Property i -> (Propellor Result -> Propellor Result) -> Property i adjustPropertySatisfy (IProperty d s i cs) f = IProperty d (f s) i cs adjustPropertySatisfy (SProperty d s cs) f = SProperty d (f s) cs @@ -172,7 +174,7 @@ propertyDesc (IProperty d _ _ _) = d propertyDesc (SProperty d _ _) = d instance Show (Property i) where - show p = "property " ++ show (propertyDesc p) + show p = "property " ++ show (propertyDesc p) -- | A Property can include a list of child properties that it also -- satisfies. This allows them to be introspected to collect their info, etc. @@ -188,7 +190,7 @@ data RevertableProperty i = RevertableProperty } instance Show (RevertableProperty i) where - show (RevertableProperty p _) = show p + show (RevertableProperty p _) = show p class MkRevertableProperty i1 i2 where -- | Shorthand to construct a revertable property. @@ -216,7 +218,7 @@ instance IsProp (Property HasInfo) where setDesc (IProperty _ a i cs) d = IProperty d a i cs toProp = id getDesc = propertyDesc - getInfoRecursive (IProperty _ _ i cs) = + getInfoRecursive (IProperty _ _ i cs) = i <> mconcat (map getInfoRecursive cs) instance IsProp (Property NoInfo) where setDesc (SProperty _ a cs) d = SProperty d a cs @@ -256,8 +258,8 @@ type ResultCombiner = Propellor Result -> Propellor Result -> Propellor Result class Combines x y where -- | 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. - combineWith + -- property as a child. + combineWith :: ResultCombiner -- ^ How to combine the actions to satisfy the properties. -> ResultCombiner @@ -308,7 +310,7 @@ instance Combines (Property HasInfo) (RevertableProperty HasInfo) where instance Combines (Property NoInfo) (RevertableProperty HasInfo) where combineWith = combineWithPR -combineWithRR +combineWithRR :: Combines (Property x) (Property y) => ResultCombiner -> ResultCombiner -- cgit v1.2.3