From 4c4f702cff18ad51dd3e9c3af4604d896aa1d7ce Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 00:14:50 -0400 Subject: [PATCH] propellor spin --- Propellor/Property.hs | 20 -------------------- config-joey.hs | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/Propellor/Property.hs b/Propellor/Property.hs index ccc060f..e334bfb 100644 --- a/Propellor/Property.hs +++ b/Propellor/Property.hs @@ -119,23 +119,3 @@ infixl 1 & q = revert p infixl 1 ! - --- | Makes a propertyList of a set of properties, using the same syntax --- used by `host`. --- --- > template "my template" $ props --- & someproperty --- ! oldproperty --- --- Note that none of the properties can define Attrs, because --- they will not propigate out to the host that this is added to. --- --- Unfortunately, this is not currently enforced at the type level, so --- attempting to set an Attr in here will be run time error. -template :: Desc -> Host -> Property -template desc h@(Host ps _) - | hostAttr h == hostAttr props = propertyList desc ps - | otherwise = error $ desc ++ ": template contains Attr" - -props :: Host -props = Host [] (\_ -> hostnameless) diff --git a/config-joey.hs b/config-joey.hs index 0e8c9a7..cd0583f 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -29,9 +29,8 @@ hosts = & Apt.buildDep ["git-annex"] `period` Daily -- Nothing super-important lives here. - , host "clam.kitenet.net" - -- & cleanCloudAtCost - & standardSystem Unstable + , standardSystem "clam.kitenet.net" Unstable + & cleanCloudAtCost & Apt.unattendedUpgrades & Network.ipv6to4 & Tor.isBridge @@ -40,18 +39,17 @@ hosts = & JoeySites.oldUseNetShellBox & cname "openid.kitenet.net" - -- & Docker.docked hosts "openid-provider" - -- `requires` Apt.installed ["ntp"] + & Docker.docked hosts "openid-provider" + `requires` Apt.installed ["ntp"] & cname "ancient.kitenet.net" - -- & Docker.docked hosts "ancient-kitenet" + & Docker.docked hosts "ancient-kitenet" - -- & Docker.garbageCollected `period` Daily + & Docker.garbageCollected `period` Daily & Apt.installed ["git-annex", "mtr", "screen"] -- Orca is the main git-annex build box. - , host "orca.kitenet.net" - & standardSystem Unstable + , standardSystem "orca.kitenet.net" Unstable & Hostname.sane & Apt.unattendedUpgrades & Docker.configured @@ -63,8 +61,7 @@ hosts = & Apt.buildDep ["git-annex"] `period` Daily -- Important stuff that needs not too much memory or CPU. - , host "diatom.kitenet.net" - & standardSystem Stable + , standardSystem "diatom.kitenet.net" Stable & Hostname.sane & Apt.unattendedUpgrades & Apt.serviceInstalledRunning "ntp" @@ -137,9 +134,9 @@ gitAnnexBuilder arch buildminute = Docker.container (arch ++ "-git-annex-builder & GitAnnexBuilder.builder arch (show buildminute ++ " * * * *") True & Apt.unattendedUpgrades --- This is my standard system setup -standardSystem :: DebianSuite -> Property -standardSystem suite = template "standard system" $ props +-- This is my standard system setup. +standardSystem :: HostName -> DebianSuite -> Host +standardSystem hn suite = host hn & Apt.stdSourcesList suite `onChange` Apt.upgrade & Apt.installed ["etckeeper"] & Apt.installed ["ssh"]