2014-04-10 21:22:32 +00:00
|
|
|
{-# LANGUAGE PackageImports #-}
|
|
|
|
|
2014-03-31 04:43:28 +00:00
|
|
|
-- | Pulls in lots of useful modules for building and using Properties.
|
2014-03-31 05:06:44 +00:00
|
|
|
--
|
2014-04-11 01:09:20 +00:00
|
|
|
-- 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.
|
2014-03-31 04:43:28 +00:00
|
|
|
--
|
|
|
|
-- A simple propellor program example:
|
|
|
|
--
|
2014-03-31 05:06:44 +00:00
|
|
|
-- > import Propellor
|
|
|
|
-- > import Propellor.CmdLine
|
|
|
|
-- > import qualified Propellor.Property.File as File
|
|
|
|
-- > import qualified Propellor.Property.Apt as Apt
|
|
|
|
-- >
|
|
|
|
-- > main :: IO ()
|
2014-04-11 01:09:20 +00:00
|
|
|
-- > main = defaultMain hosts
|
2014-03-31 05:06:44 +00:00
|
|
|
-- >
|
2014-04-11 01:09:20 +00:00
|
|
|
-- > hosts :: [Host]
|
|
|
|
-- > hosts =
|
|
|
|
-- > [ host "example.com"
|
|
|
|
-- > & Apt.installed ["mydaemon"]
|
|
|
|
-- > & "/etc/mydaemon.conf" `File.containsLine` "secure=1"
|
|
|
|
-- > `onChange` cmdProperty "service" ["mydaemon", "restart"]
|
|
|
|
-- > ! Apt.installed ["unwantedpackage"]
|
|
|
|
-- > ]
|
2014-03-31 04:43:28 +00:00
|
|
|
--
|
|
|
|
-- See config.hs for a more complete example, and clone Propellor's
|
|
|
|
-- git repository for a deployable system using Propellor:
|
2015-01-19 18:29:09 +00:00
|
|
|
-- git clone <git://git.joeyh.name/propellor>
|
2014-03-31 03:55:59 +00:00
|
|
|
|
2014-03-31 04:43:28 +00:00
|
|
|
module Propellor (
|
|
|
|
module Propellor.Types
|
|
|
|
, module Propellor.Property
|
2015-01-25 02:38:10 +00:00
|
|
|
, module Propellor.Property.List
|
2014-03-31 04:43:28 +00:00
|
|
|
, module Propellor.Property.Cmd
|
2015-01-19 18:15:49 +00:00
|
|
|
, module Propellor.PropAccum
|
2014-06-09 05:45:58 +00:00
|
|
|
, module Propellor.Info
|
2014-03-31 04:43:28 +00:00
|
|
|
, module Propellor.PrivData
|
2014-12-07 18:57:35 +00:00
|
|
|
, module Propellor.Types.PrivData
|
2014-03-31 05:06:44 +00:00
|
|
|
, module Propellor.Engine
|
2014-04-10 21:22:32 +00:00
|
|
|
, module Propellor.Exception
|
2014-03-31 22:31:08 +00:00
|
|
|
, module Propellor.Message
|
2014-04-01 17:51:58 +00:00
|
|
|
, localdir
|
2014-03-30 19:31:57 +00:00
|
|
|
|
2014-03-31 04:43:28 +00:00
|
|
|
, module X
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Propellor.Types
|
|
|
|
import Propellor.Property
|
2014-03-31 05:06:44 +00:00
|
|
|
import Propellor.Engine
|
2015-01-25 02:38:10 +00:00
|
|
|
import Propellor.Property.List
|
2014-03-31 04:43:28 +00:00
|
|
|
import Propellor.Property.Cmd
|
|
|
|
import Propellor.PrivData
|
2014-12-07 18:57:35 +00:00
|
|
|
import Propellor.Types.PrivData
|
2014-03-31 22:31:08 +00:00
|
|
|
import Propellor.Message
|
2014-04-10 21:22:32 +00:00
|
|
|
import Propellor.Exception
|
2014-06-09 05:45:58 +00:00
|
|
|
import Propellor.Info
|
2015-01-19 18:15:49 +00:00
|
|
|
import Propellor.PropAccum
|
2014-03-30 19:31:57 +00:00
|
|
|
|
2014-03-30 23:10:32 +00:00
|
|
|
import Utility.PartialPrelude as X
|
2014-03-30 19:31:57 +00:00
|
|
|
import Utility.Process as X
|
|
|
|
import Utility.Exception as X
|
|
|
|
import Utility.Env as X
|
|
|
|
import Utility.Directory as X
|
|
|
|
import Utility.Tmp as X
|
2014-03-31 03:55:59 +00:00
|
|
|
import Utility.Monad as X
|
|
|
|
import Utility.Misc as X
|
|
|
|
|
|
|
|
import System.Directory as X
|
|
|
|
import System.IO as X
|
2014-03-30 19:31:57 +00:00
|
|
|
import System.FilePath as X
|
|
|
|
import Data.Maybe as X
|
|
|
|
import Data.Either as X
|
2014-03-31 03:55:59 +00:00
|
|
|
import Control.Applicative as X
|
|
|
|
import Control.Monad as X
|
2014-03-31 14:36:45 +00:00
|
|
|
import Data.Monoid as X
|
2014-03-31 20:20:38 +00:00
|
|
|
import Control.Monad.IfElse as X
|
2014-04-10 21:22:32 +00:00
|
|
|
import "mtl" Control.Monad.Reader as X
|
2014-04-01 17:51:58 +00:00
|
|
|
|
|
|
|
-- | This is where propellor installs itself when deploying a host.
|
|
|
|
localdir :: FilePath
|
|
|
|
localdir = "/usr/local/propellor"
|