summaryrefslogtreecommitdiff
path: root/Propellor.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-04-11 01:09:01 -0400
committerJoey Hess <joey@kitenet.net>2014-04-11 01:09:01 -0400
commit856ce97995bc34e35fd8e0233341f26a37b19cf5 (patch)
tree1d93492b36cd07d58437d2cb0f902ad53b3abe6e /Propellor.hs
parent07a071ac7f5b2f71e376a9a1a78a84a6bf02129b (diff)
parent47ff089f844c707eaa3ffd7255dc733721fb6adf (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'Propellor.hs')
-rw-r--r--Propellor.hs29
1 files changed, 19 insertions, 10 deletions
diff --git a/Propellor.hs b/Propellor.hs
index e39fc97d..e6312248 100644
--- a/Propellor.hs
+++ b/Propellor.hs
@@ -1,7 +1,10 @@
+{-# LANGUAGE PackageImports #-}
+
-- | Pulls in lots of useful modules for building and using Properties.
--
--- Propellor enures that the system it's run in satisfies a list of
--- properties, taking action as necessary when a property is not yet met.
+-- When propellor runs on a Host, it ensures that its list of Properties
+-- is satisfied, taking action as necessary when a Property is not
+-- currently satisfied.
--
-- A simple propellor program example:
--
@@ -11,15 +14,16 @@
-- > import qualified Propellor.Property.Apt as Apt
-- >
-- > main :: IO ()
--- > main = defaultMain getProperties
+-- > main = defaultMain hosts
-- >
--- > getProperties :: HostName -> Maybe [Property]
--- > getProperties "example.com" = Just
--- > [ Apt.installed ["mydaemon"]
--- > , "/etc/mydaemon.conf" `File.containsLine` "secure=1"
--- > `onChange` cmdProperty "service" ["mydaemon", "restart"]
--- > ]
--- > getProperties _ = Nothing
+-- > hosts :: [Host]
+-- > hosts =
+-- > [ host "example.com"
+-- > & 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:
@@ -29,8 +33,10 @@ module Propellor (
module Propellor.Types
, module Propellor.Property
, module Propellor.Property.Cmd
+ , module Propellor.Attr
, module Propellor.PrivData
, module Propellor.Engine
+ , module Propellor.Exception
, module Propellor.Message
, localdir
@@ -43,6 +49,8 @@ import Propellor.Engine
import Propellor.Property.Cmd
import Propellor.PrivData
import Propellor.Message
+import Propellor.Exception
+import Propellor.Attr
import Utility.PartialPrelude as X
import Utility.Process as X
@@ -62,6 +70,7 @@ import Control.Applicative as X
import Control.Monad as X
import Data.Monoid as X
import Control.Monad.IfElse as X
+import "mtl" Control.Monad.Reader as X
-- | This is where propellor installs itself when deploying a host.
localdir :: FilePath