propellor spin

This commit is contained in:
Joey Hess 2014-03-31 01:29:47 -04:00
parent 48b4626af2
commit 51fc590b61
3 changed files with 24 additions and 0 deletions

View File

@ -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"

View File

@ -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
]

View File

@ -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