From 5df3ad13dfdccf01248368bb8e5fc0dc8d164910 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Apr 2014 23:01:40 -0400 Subject: [PATCH] awesome new revert operator! --- Propellor/Property.hs | 5 +++++ config.hs | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Propellor/Property.hs b/Propellor/Property.hs index 29f6bb8..e7ec704 100644 --- a/Propellor/Property.hs +++ b/Propellor/Property.hs @@ -88,3 +88,8 @@ props = [] (&) :: IsProp p => [Property] -> p -> [Property] ps & p = ps ++ [toProp p] infixl 1 & + +-- | Adds a property to the list in reverted form. +(!) :: [Property] -> RevertableProperty -> [Property] +ps ! p = ps ++ [toProp $ revert p] +infixl 1 ! diff --git a/config.hs b/config.hs index a769499..09f1113 100644 --- a/config.hs +++ b/config.hs @@ -43,8 +43,8 @@ host hostname@"clam.kitenet.net" = Just $ props & JoeySites.oldUseNetshellBox & Docker.configured & File.dirExists "/var/www" - & revert (Docker.docked container hostname "webserver") - & revert (Docker.docked container hostname "amd64-git-annex-builder") + ! Docker.docked container hostname "webserver" + ! Docker.docked container hostname "amd64-git-annex-builder" & Docker.garbageCollected -- Should come last as it reboots. & Apt.installed ["systemd-sysv"] `onChange` Reboot.now @@ -53,8 +53,8 @@ host hostname@"orca.kitenet.net" = Just $ props & standardSystem Unstable & Apt.unattendedUpgrades & Docker.configured - & Docker.docked container hostname "amd64-git-annex-builder" - & revert (Docker.docked container hostname "i386-git-annex-builder") + ! Docker.docked container hostname "amd64-git-annex-builder" + ! Docker.docked container hostname "i386-git-annex-builder" & Docker.garbageCollected -- add more hosts here... --host "foo.example.com" =