propellor/config-simple.hs

41 lines
1.3 KiB
Haskell
Raw Normal View History

2014-04-01 22:56:56 +00:00
import Propellor
import Propellor.CmdLine
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Cron as Cron
2015-08-15 07:48:39 +00:00
import qualified Propellor.Property.Docker as Docker
2014-04-01 22:56:56 +00:00
2014-04-19 21:08:20 +00:00
main :: IO ()
main = defaultMain hosts
2014-04-11 03:20:12 +00:00
hosts :: [Host]
hosts =
2015-08-15 07:06:54 +00:00
[ host "hermit"
& os (System (Debian (Stable "jessie")) "amd64")
& Apt.stdSourcesList
2015-08-15 07:25:03 +00:00
& Apt.installed ["ssh", "build-essential"]
2015-08-15 07:06:54 +00:00
& Cron.runPropellor (Cron.Times "30 * * * *")
2015-08-15 07:48:39 +00:00
& Docker.configured
, host "empress"
2015-08-15 07:15:55 +00:00
& os (System (Debian (Stable "jessie")) "amd64")
& Apt.stdSourcesList
2015-08-15 07:25:03 +00:00
& Apt.installed ["ssh", "build-essential"]
& Cron.runPropellor (Cron.Times "30 * * * *")
2015-08-15 07:48:39 +00:00
& Docker.configured
2015-08-15 05:27:47 +00:00
]
2015-08-15 07:48:39 +00:00
standardStableContainer :: Docker.ContainerName -> Docker.Container
standardStableContainer name = standardContainer name (Stable "jessie") "amd64"
standardContainer :: Docker.ContainerName -> DebianSuite -> Architecture -> Docker.Container
standardContainer name suite arch = Docker.container name (dockerImage system)
& os system
& Apt.stdSourcesList `onChange` Apt.upgrade
& Apt.unattendedUpgrades
& Apt.cacheCleaned
& Docker.tweaked
where
system = System (Debian suite) arch
dockerImage :: System -> Docker.Image
dockerImage _ = Docker.latestImage "debian"