summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-10-23 11:46:15 -0400
committerJoey Hess2014-10-23 11:46:15 -0400
commite6924a894d32697747795bd78d7ee1cad92af5a7 (patch)
tree3b6b78300ed939e91bbe7acc84986dd71b0cd111 /src/Propellor
parentc6a488157c31bafcbdea83b93ff7d4d657ce26c4 (diff)
Revert "Revert "Revert "propellor spin"""
This reverts commit 26bef2486d27b2cde6feda633c6a7509675a3fe5.
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property.hs10
-rw-r--r--src/Propellor/Property/Docker.hs2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index ce825192..4b957317 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -135,7 +135,7 @@ host hn = Host hn [] mempty
--
-- Can add Properties and RevertableProperties
(&) :: IsProp p => Host -> p -> Host
-(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p)
+(Host hn ps is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p)
infixl 1 &
@@ -145,6 +145,14 @@ h ! p = h & revert p
infixl 1 !
+-- | Like (&), but adds the property as the first property of the host.
+-- Normally, property order should not matter, but this is useful
+-- when it does.
+(&^) :: IsProp p => Host -> p -> Host
+(Host hn ps is) &^ p = Host hn ([toProp p] ++ ps) (getInfo p <> is)
+
+infixl 1 &^
+
-- Changes the action that is performed to satisfy a property.
adjustProperty :: Property -> (Propellor Result -> Propellor Result) -> Property
adjustProperty p f = p { propertySatisfy = f (propertySatisfy p) }
diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs
index 0e71acd3..b717fe19 100644
--- a/src/Propellor/Property/Docker.hs
+++ b/src/Propellor/Property/Docker.hs
@@ -157,7 +157,7 @@ mkContainer cid@(ContainerId hn _cn) h = Container
h' = h
-- Restart by default so container comes up on
-- boot or when docker is upgraded.
- -- &^ restart RestartAlways
+ &^ restart RestartAlways
-- Expose propellor directory inside the container.
& volume (localdir++":"++localdir)
-- Name the container in a predictable way so we