summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-10-23 11:28:10 -0400
committerJoey Hess2014-10-23 11:28:10 -0400
commit45ce3a5e8ccf90e357dbaf6e0152daa4de88b7fd (patch)
tree0a4d653f10fe987fa4ca20d9cedb4c68cf2e590c
parent80f5b53f1b7fdc876d5e45df68c29f53bd9666b2 (diff)
propellor spin
-rw-r--r--config-joey.hs2
-rw-r--r--src/Propellor/Property/Docker.hs26
2 files changed, 2 insertions, 26 deletions
diff --git a/config-joey.hs b/config-joey.hs
index 9d54b512..3bf01114 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net"
& Apt.buildDep ["git-annex"] `period` Daily
& Docker.configured
! Docker.docked hosts "android-git-annex"
- & Docker.docked hosts "test"
+ ! Docker.docked hosts "webserver"
clam :: Host
clam = standardSystem "clam.kitenet.net" Unstable "amd64"
diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs
index de3c64fb..8c2f3701 100644
--- a/src/Propellor/Property/Docker.hs
+++ b/src/Propellor/Property/Docker.hs
@@ -30,8 +30,6 @@ module Propellor.Property.Docker (
cpuShares,
link,
ContainerAlias,
- restart,
- RestartPolicy(..),
-- * Internal use
chain,
) where
@@ -152,7 +150,7 @@ findContainer mhost cid cn mk = case mhost of
mkContainer :: ContainerId -> Host -> Maybe Container
mkContainer cid@(ContainerId hn _cn) h = Container
<$> fromVal (_dockerImage info)
- <*> pure (map (\mkparam -> mkparam hn) (_dockerRunParams info))
+ <*> pure (map (\a -> a hn) (_dockerRunParams info))
where
info = _dockerinfo $ hostInfo h'
h' = h
@@ -161,7 +159,6 @@ mkContainer cid@(ContainerId hn _cn) h = Container
-- name the container in a predictable way so we
-- and the user can easily find it later
& name (fromContainerId cid)
- & restart RestartAlways
-- | Causes *any* docker images that are not in use by running containers to
-- be deleted. And deletes any containers that propellor has set up
@@ -277,27 +274,6 @@ link linkwith calias = genProp "link" $ \hn ->
-- Each container has its own alias namespace.
type ContainerAlias = String
--- | Restart policy to apply when a container exits.
-restart :: RestartPolicy -> Property
-restart policy = runProp "restart" (serialize policy)
- where
- serialize NoRestart = "no"
- serialize (RestartOnFailure Nothing) = "on-failure"
- serialize (RestartOnFailure n) = "on-failure:" ++ show n
- serialize RestartAlways = "always"
-
--- | NoRestart makes docker not restart a container when it exits
--- Note that this includes not restarting it on boot!
---
--- RestartOnFailure will restart the container if it exits nonzero.
--- A max-retry value can be provided to prevent repeated restarts.
---
--- RestartAlways is the default for docker containers configured by
--- propellor; as well as keeping badly behaved containers running,
--- it ensures that containers get started back up after reboot or
--- after docker is upgraded.
-data RestartPolicy = NoRestart | RestartOnFailure (Maybe Int) | RestartAlways
-
-- | A container is identified by its name, and the host
-- on which it's deployed.
data ContainerId = ContainerId HostName ContainerName