diff options
| author | Joey Hess <joey@kitenet.net> | 2014-03-31 01:29:47 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-03-31 01:29:47 -0400 |
| commit | 51fc590b61a7e68a5e038919f1aaea7a1d9fcc71 (patch) | |
| tree | a48fa9edb4ddf16a83d7b27767e5514d94c8c5f1 | |
| parent | 48b4626af26ac8a8ed21692752af09a9e0d0b93e (diff) | |
propellor spin
| -rw-r--r-- | Propellor/Property/Cron.hs | 21 | ||||
| -rw-r--r-- | config.hs | 2 | ||||
| -rw-r--r-- | propellor.cabal | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Propellor/Property/Cron.hs b/Propellor/Property/Cron.hs new file mode 100644 index 00000000..a3bc745d --- /dev/null +++ b/Propellor/Property/Cron.hs @@ -0,0 +1,21 @@ +module Propellor.Property.Cron where + +import Propellor +import qualified Propellor.Property.File as File +import qualified Propellor.Property.Apt as Apt +import Propellor.CmdLine + +type CronTimes = String + +-- | Installs a cron job to run propellor. +runPropellor :: CronTimes -> Property +runPropellor times = "/etc/cron.d/propellor" `File.hasContent` + [ "# Run propellor" + , "" + , "SHELL=/bin/sh" + , "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" + , "" + , times ++ "\troot\tcd " ++ localdir ++ " && nice ionice -c 3 chronic make" + ] + `requires` Apt.installed ["moreutils"] + `describe` "cronned propeller" @@ -7,6 +7,7 @@ import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Network as Network import qualified Propellor.Property.Ssh as Ssh +import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Sudo as Sudo import qualified Propellor.Property.User as User import qualified Propellor.Property.Hostname as Hostname @@ -63,6 +64,7 @@ standardSystem suite = propertyList "standard system" , Sudo.enabledFor "joey" , GitHome.installedFor "joey" , Apt.installed ["vim", "screen"] + , Cron.runPropellor "30 * * * *" -- I use postfix, or no MTA. , Apt.removed ["exim4"] `onChange` Apt.autoRemove ] diff --git a/propellor.cabal b/propellor.cabal index 19fde6cf..0abc7d7c 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -47,6 +47,7 @@ Library Propellor.Property Propellor.Property.Apt Propellor.Property.Cmd + Propellor.Property.Cron Propellor.Property.Docker Propellor.Property.File Propellor.Property.GitHome |
