awesome new revert operator!

This commit is contained in:
Joey Hess 2014-04-02 23:01:40 -04:00
parent 5674818300
commit 5df3ad13df
2 changed files with 9 additions and 4 deletions

View File

@ -88,3 +88,8 @@ props = []
(&) :: IsProp p => [Property] -> p -> [Property] (&) :: IsProp p => [Property] -> p -> [Property]
ps & p = ps ++ [toProp p] ps & p = ps ++ [toProp p]
infixl 1 & infixl 1 &
-- | Adds a property to the list in reverted form.
(!) :: [Property] -> RevertableProperty -> [Property]
ps ! p = ps ++ [toProp $ revert p]
infixl 1 !

View File

@ -43,8 +43,8 @@ host hostname@"clam.kitenet.net" = Just $ props
& JoeySites.oldUseNetshellBox & JoeySites.oldUseNetshellBox
& Docker.configured & Docker.configured
& File.dirExists "/var/www" & File.dirExists "/var/www"
& revert (Docker.docked container hostname "webserver") ! Docker.docked container hostname "webserver"
& revert (Docker.docked container hostname "amd64-git-annex-builder") ! Docker.docked container hostname "amd64-git-annex-builder"
& Docker.garbageCollected & Docker.garbageCollected
-- Should come last as it reboots. -- Should come last as it reboots.
& Apt.installed ["systemd-sysv"] `onChange` Reboot.now & Apt.installed ["systemd-sysv"] `onChange` Reboot.now
@ -53,8 +53,8 @@ host hostname@"orca.kitenet.net" = Just $ props
& standardSystem Unstable & standardSystem Unstable
& Apt.unattendedUpgrades & Apt.unattendedUpgrades
& Docker.configured & Docker.configured
& Docker.docked container hostname "amd64-git-annex-builder" ! Docker.docked container hostname "amd64-git-annex-builder"
& revert (Docker.docked container hostname "i386-git-annex-builder") ! Docker.docked container hostname "i386-git-annex-builder"
& Docker.garbageCollected & Docker.garbageCollected
-- add more hosts here... -- add more hosts here...
--host "foo.example.com" = --host "foo.example.com" =