propellor spin
This commit is contained in:
parent
48b4626af2
commit
51fc590b61
|
@ -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
|
||||
]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue