summaryrefslogtreecommitdiff
path: root/config.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-02 12:13:39 -0400
committerJoey Hess2014-04-02 13:18:08 -0400
commit526bcbf093af665f316a0ba4d1a836786ab66dcf (patch)
treed4ceb9ec125587cfac37cb50c178fcc4624dcedf /config.hs
parent7705f65ae22f38989f404c77de4d661b652e692e (diff)
type-safe reversions
Diffstat (limited to 'config.hs')
-rw-r--r--config.hs55
1 files changed, 26 insertions, 29 deletions
diff --git a/config.hs b/config.hs
index b212fda3..3ed28c26 100644
--- a/config.hs
+++ b/config.hs
@@ -2,7 +2,7 @@
-- the propellor program.
--
-- This is the live config file used by propellor's author.
--- For a simpler starting point, see config.hs.simple.
+-- For a simpler starting point, see simple-config.hs
import Propellor
import Propellor.CmdLine
@@ -31,33 +31,31 @@ main = defaultMain [host, Docker.containerProperties container]
--
-- Edit this to configure propellor!
host :: HostName -> Maybe [Property]
-host hostname@"clam.kitenet.net" = Just
- [ cleanCloudAtCost hostname
- , standardSystem Unstable
- , Apt.unattendedUpgrades True
- , Network.ipv6to4
+host hostname@"clam.kitenet.net" = Just $ props
+ & cleanCloudAtCost hostname
+ & standardSystem Unstable
+ & Apt.unattendedUpgrades
+ & Network.ipv6to4
+ & Apt.installed ["git-annex", "mtr"]
-- Clam is a tor bridge, and an olduse.net shellbox and other
-- fun stuff.
- , Tor.isBridge
- , JoeySites.oldUseNetshellBox
- , Docker.configured
- , File.dirExists "/var/www"
- --, Docker.docked container hostname "webserver"
- , Docker.garbageCollected
- , Docker.unDocked container hostname "amd64-git-annex-builder"
- , Apt.installed ["git-annex", "mtr"]
+ & Tor.isBridge
+ & JoeySites.oldUseNetshellBox
+ & Docker.configured
+ & File.dirExists "/var/www"
+ & revert (Docker.docked container hostname "webserver")
+ & revert (Docker.docked container hostname "amd64-git-annex-builder")
+ & Docker.garbageCollected
-- Should come last as it reboots.
- , Apt.installed ["systemd-sysv"] `onChange` Reboot.now
- ]
-host hostname@"orca.kitenet.net" = Just
- [ Hostname.set hostname
- , standardSystem Unstable
- , Apt.unattendedUpgrades True
- , Docker.configured
- , Docker.unDocked container hostname "amd64-git-annex-builder"
- , Docker.unDocked container hostname "i386-git-annex-builder"
- , Docker.garbageCollected
- ]
+ & Apt.installed ["systemd-sysv"] `onChange` Reboot.now
+host hostname@"orca.kitenet.net" = Just $ props
+ & Hostname.set hostname
+ & standardSystem Unstable
+ & Apt.unattendedUpgrades
+ & Docker.configured
+ & revert (Docker.docked container hostname "amd64-git-annex-builder")
+ & revert (Docker.docked container hostname "i386-git-annex-builder")
+ & Docker.garbageCollected
-- add more hosts here...
--host "foo.example.com" =
host _ = Nothing
@@ -70,16 +68,15 @@ container _host name
(image $ System (Debian Unstable) "amd64")
[ Docker.publish "8080:80"
, Docker.volume "/var/www:/var/www"
- , Docker.inside
- [ serviceRunning "apache2"
+ , Docker.inside $ props
+ & serviceRunning "apache2"
`requires` Apt.installed ["apache2"]
- ]
]
| "-git-annex-builder" `isSuffixOf` name =
let arch = takeWhile (/= '-') name
in Just $ Docker.containerFrom
(image $ System (Debian Unstable) arch)
- [ Docker.inside [ GitAnnexBuilder.builder arch "15 * * * *" ] ]
+ [ Docker.inside $ props & GitAnnexBuilder.builder arch "15 * * * *" ]
| otherwise = Nothing
-- | Docker images I prefer to use.