propellor spin

This commit is contained in:
Christine Dodrill 2015-08-15 01:30:42 -07:00
parent 189efdd146
commit 83c9cd361b
No known key found for this signature in database
GPG Key ID: E9037B677CE55004
1 changed files with 23 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import Propellor
import Propellor.CmdLine
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Cmd as Cmd
import qualified Propellor.Property.Cron as Cron
import qualified Propellor.Property.Docker as Docker
@ -9,20 +10,30 @@ main = defaultMain hosts
hosts :: [Host]
hosts =
[ host "hermit"
& os (System (Debian (Stable "jessie")) "amd64")
& Apt.stdSourcesList
& Apt.installed ["ssh", "build-essential"]
& Cron.runPropellor (Cron.Times "30 * * * *")
& Docker.configured
, host "empress"
& os (System (Debian (Stable "jessie")) "amd64")
& Apt.stdSourcesList
& Apt.installed ["ssh", "build-essential"]
& Cron.runPropellor (Cron.Times "30 * * * *")
& Docker.configured
[ baseHost "hermit"
, baseHost "empress"
]
nimInstall :: Cmd.Script
nimInstall =
[ "mkdir /tmp/niminstall -p"
, "cd /tmp/niminstall"
, "wget http://nim-lang.org/download/nim-0.11.2.tar.xz"
, "tar xf nim-0.11.2.tar.xz"
, "mv nim-0.11.2 /usr/local/nim"
, "cd /usr/local/nim"
, "./build.sh"
]
baseHost :: HostName -> Host
baseHost name = host name
& os (System (Debian (Stable "jessie")) "amd64")
& Apt.stdSourcesList
& Apt.installed ["ssh", "build-essential"]
& Cron.runPropellor (Cron.Times "30 * * * *")
& Docker.configured
& Cmd.scriptProperty nimInstall
standardStableContainer :: Docker.ContainerName -> Docker.Container
standardStableContainer name = standardContainer name (Stable "jessie") "amd64"