From 93099b862768235d3f9936435f6f65292b8d9b7c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 03:18:52 -0400 Subject: bugfix --- src/Propellor/Property.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property.hs') diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index ce825192..87136042 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 & -- cgit v1.3-2-g0d8e From 856a4c673cc890b1e2e5ee749bdc70ea6d7f1cb9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 03:27:40 -0400 Subject: propellor spin --- debian/changelog | 2 +- src/Propellor/Property.hs | 8 ++++++++ src/Propellor/Property/Docker.hs | 22 +++++++++------------- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/debian/changelog b/debian/changelog index 043ef508..9e90877d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ propellor (0.9.1) UNRELEASED; urgency=medium * Docker: Add ability to control when containers restart. - * Docker: Defaut to always restarting containers, so they come back + * Docker: Default to always restarting containers, so they come back up after reboots and docker daemon upgrades. -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 87136042..4b957317 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -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 358cc8c3..b717fe19 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -19,7 +19,6 @@ module Propellor.Property.Docker ( -- * Container configuration dns, hostname, - name, publish, expose, user, @@ -156,10 +155,14 @@ mkContainer cid@(ContainerId hn _cn) h = Container where info = _dockerinfo $ hostInfo h' h' = h - -- expose propellor directory inside the container + -- Restart by default so container comes up on + -- boot or when docker is upgraded. + &^ restart RestartAlways + -- Expose propellor directory inside the container. & volume (localdir++":"++localdir) - -- name the container in a predictable way so we - -- and the user can easily find it later + -- Name the container in a predictable way so we + -- and the user can easily find it later. This property + -- comes last, so it cannot be overridden. & name (fromContainerId cid) -- | Causes *any* docker images that are not in use by running containers to @@ -219,7 +222,7 @@ dns = runProp "dns" hostname :: String -> Property hostname = runProp "hostname" --- | Set name for container. (Normally done automatically.) +-- | Set name of container. name :: String -> Property name = runProp "name" @@ -382,14 +385,7 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope shim <- liftIO $ Shim.setup (localdir "propellor") (localdir shimdir cid) liftIO $ writeFile (identFile cid) (show ident) ensureProperty $ boolProperty "run" $ runContainer img - -- Restart by default so container comes up on - -- boot or when docker is upgraded. This is put - -- here, rather than adding a default Property - -- in mkContainer, to avoid changing the ident - -- of existing containers. Any restart property - -- will override it. - -- This is a hack. TODO: Move to correct place. - ("--restart=always" : runps ++ ["-i", "-d", "-t"]) + (runps ++ ["-i", "-d", "-t"]) [shim, "--docker", fromContainerId cid] -- | Called when propellor is running inside a docker container. -- cgit v1.3-2-g0d8e From 7637ea0af9ff4056cbdc16f25016785442d4b97e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:23:25 -0400 Subject: propellor spin --- debian/changelog | 2 +- src/Propellor/Property.hs | 10 +--------- src/Propellor/Property/Docker.hs | 22 +++++++++++++--------- 3 files changed, 15 insertions(+), 19 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/debian/changelog b/debian/changelog index 9e90877d..043ef508 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ propellor (0.9.1) UNRELEASED; urgency=medium * Docker: Add ability to control when containers restart. - * Docker: Default to always restarting containers, so they come back + * Docker: Defaut to always restarting containers, so they come back up after reboots and docker daemon upgrades. -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 4b957317..ce825192 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 is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) +(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) infixl 1 & @@ -145,14 +145,6 @@ 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 b717fe19..358cc8c3 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -19,6 +19,7 @@ module Propellor.Property.Docker ( -- * Container configuration dns, hostname, + name, publish, expose, user, @@ -155,14 +156,10 @@ mkContainer cid@(ContainerId hn _cn) h = Container where info = _dockerinfo $ hostInfo h' h' = h - -- Restart by default so container comes up on - -- boot or when docker is upgraded. - &^ restart RestartAlways - -- Expose propellor directory inside the container. + -- expose propellor directory inside the container & volume (localdir++":"++localdir) - -- Name the container in a predictable way so we - -- and the user can easily find it later. This property - -- comes last, so it cannot be overridden. + -- name the container in a predictable way so we + -- and the user can easily find it later & name (fromContainerId cid) -- | Causes *any* docker images that are not in use by running containers to @@ -222,7 +219,7 @@ dns = runProp "dns" hostname :: String -> Property hostname = runProp "hostname" --- | Set name of container. +-- | Set name for container. (Normally done automatically.) name :: String -> Property name = runProp "name" @@ -385,7 +382,14 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope shim <- liftIO $ Shim.setup (localdir "propellor") (localdir shimdir cid) liftIO $ writeFile (identFile cid) (show ident) ensureProperty $ boolProperty "run" $ runContainer img - (runps ++ ["-i", "-d", "-t"]) + -- Restart by default so container comes up on + -- boot or when docker is upgraded. This is put + -- here, rather than adding a default Property + -- in mkContainer, to avoid changing the ident + -- of existing containers. Any restart property + -- will override it. + -- This is a hack. TODO: Move to correct place. + ("--restart=always" : runps ++ ["-i", "-d", "-t"]) [shim, "--docker", fromContainerId cid] -- | Called when propellor is running inside a docker container. -- cgit v1.3-2-g0d8e From 5bfeb3f9aad1108907544deb0b04ccc58b5614c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:25:07 -0400 Subject: Revert "propellor spin" This reverts commit 7637ea0af9ff4056cbdc16f25016785442d4b97e. --- debian/changelog | 2 +- src/Propellor/Property.hs | 10 +++++++++- src/Propellor/Property/Docker.hs | 22 +++++++++------------- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/debian/changelog b/debian/changelog index 043ef508..9e90877d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ propellor (0.9.1) UNRELEASED; urgency=medium * Docker: Add ability to control when containers restart. - * Docker: Defaut to always restarting containers, so they come back + * Docker: Default to always restarting containers, so they come back up after reboots and docker daemon upgrades. -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 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 358cc8c3..b717fe19 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -19,7 +19,6 @@ module Propellor.Property.Docker ( -- * Container configuration dns, hostname, - name, publish, expose, user, @@ -156,10 +155,14 @@ mkContainer cid@(ContainerId hn _cn) h = Container where info = _dockerinfo $ hostInfo h' h' = h - -- expose propellor directory inside the container + -- Restart by default so container comes up on + -- boot or when docker is upgraded. + &^ restart RestartAlways + -- Expose propellor directory inside the container. & volume (localdir++":"++localdir) - -- name the container in a predictable way so we - -- and the user can easily find it later + -- Name the container in a predictable way so we + -- and the user can easily find it later. This property + -- comes last, so it cannot be overridden. & name (fromContainerId cid) -- | Causes *any* docker images that are not in use by running containers to @@ -219,7 +222,7 @@ dns = runProp "dns" hostname :: String -> Property hostname = runProp "hostname" --- | Set name for container. (Normally done automatically.) +-- | Set name of container. name :: String -> Property name = runProp "name" @@ -382,14 +385,7 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope shim <- liftIO $ Shim.setup (localdir "propellor") (localdir shimdir cid) liftIO $ writeFile (identFile cid) (show ident) ensureProperty $ boolProperty "run" $ runContainer img - -- Restart by default so container comes up on - -- boot or when docker is upgraded. This is put - -- here, rather than adding a default Property - -- in mkContainer, to avoid changing the ident - -- of existing containers. Any restart property - -- will override it. - -- This is a hack. TODO: Move to correct place. - ("--restart=always" : runps ++ ["-i", "-d", "-t"]) + (runps ++ ["-i", "-d", "-t"]) [shim, "--docker", fromContainerId cid] -- | Called when propellor is running inside a docker container. -- cgit v1.3-2-g0d8e From 80f5b53f1b7fdc876d5e45df68c29f53bd9666b2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:26:05 -0400 Subject: propellor spin --- debian/changelog | 8 -------- doc/todo/docker_todo_list.mdwn | 2 -- src/Propellor/Property.hs | 10 +--------- src/Propellor/Property/Docker.hs | 30 ++++++++++++++---------------- 4 files changed, 15 insertions(+), 35 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/debian/changelog b/debian/changelog index 9e90877d..012826bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,3 @@ -propellor (0.9.1) UNRELEASED; urgency=medium - - * Docker: Add ability to control when containers restart. - * Docker: Default to always restarting containers, so they come back - up after reboots and docker daemon upgrades. - - -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 - propellor (0.9.0) unstable; urgency=medium * Avoid encoding the current stable suite in propellor's code, diff --git a/doc/todo/docker_todo_list.mdwn b/doc/todo/docker_todo_list.mdwn index 72ded426..1321445d 100644 --- a/doc/todo/docker_todo_list.mdwn +++ b/doc/todo/docker_todo_list.mdwn @@ -1,5 +1,3 @@ * There is no way for a property of a docker container to require some property be met outside the container. For example, some servers need ntp installed for a good date source. -* The SimpleSh was added before `docker exec` existed, and could probably - be eliminated by using that. diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 4b957317..ce825192 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 is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) +(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) infixl 1 & @@ -145,14 +145,6 @@ 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 b717fe19..de3c64fb 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -19,6 +19,7 @@ module Propellor.Property.Docker ( -- * Container configuration dns, hostname, + name, publish, expose, user, @@ -155,15 +156,12 @@ mkContainer cid@(ContainerId hn _cn) h = Container where info = _dockerinfo $ hostInfo h' h' = h - -- Restart by default so container comes up on - -- boot or when docker is upgraded. - &^ restart RestartAlways - -- Expose propellor directory inside the container. + -- expose propellor directory inside the container & volume (localdir++":"++localdir) - -- Name the container in a predictable way so we - -- and the user can easily find it later. This property - -- comes last, so it cannot be overridden. + -- 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 @@ -222,7 +220,7 @@ dns = runProp "dns" hostname :: String -> Property hostname = runProp "hostname" --- | Set name of container. +-- | Set name for container. (Normally done automatically.) name :: String -> Property name = runProp "name" @@ -285,19 +283,19 @@ restart policy = runProp "restart" (serialize policy) where serialize NoRestart = "no" serialize (RestartOnFailure Nothing) = "on-failure" - serialize (RestartOnFailure (Just n)) = "on-failure:" ++ show n + serialize (RestartOnFailure n) = "on-failure:" ++ show n serialize RestartAlways = "always" --- | 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. --- --- NoRestart makes docker not restart a container when it exits +-- | 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 too many restarts. +-- 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 -- cgit v1.3-2-g0d8e From bdf3e37066a2f01eac7411b77a3b26e3796f5d65 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:33:00 -0400 Subject: Revert "propellor spin" This reverts commit 80f5b53f1b7fdc876d5e45df68c29f53bd9666b2. --- debian/changelog | 8 ++++++++ doc/todo/docker_todo_list.mdwn | 2 ++ src/Propellor/Property.hs | 10 +++++++++- src/Propellor/Property/Docker.hs | 30 ++++++++++++++++-------------- 4 files changed, 35 insertions(+), 15 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/debian/changelog b/debian/changelog index 012826bd..9e90877d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +propellor (0.9.1) UNRELEASED; urgency=medium + + * Docker: Add ability to control when containers restart. + * Docker: Default to always restarting containers, so they come back + up after reboots and docker daemon upgrades. + + -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 + propellor (0.9.0) unstable; urgency=medium * Avoid encoding the current stable suite in propellor's code, diff --git a/doc/todo/docker_todo_list.mdwn b/doc/todo/docker_todo_list.mdwn index 1321445d..72ded426 100644 --- a/doc/todo/docker_todo_list.mdwn +++ b/doc/todo/docker_todo_list.mdwn @@ -1,3 +1,5 @@ * There is no way for a property of a docker container to require some property be met outside the container. For example, some servers need ntp installed for a good date source. +* The SimpleSh was added before `docker exec` existed, and could probably + be eliminated by using that. 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 de3c64fb..b717fe19 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -19,7 +19,6 @@ module Propellor.Property.Docker ( -- * Container configuration dns, hostname, - name, publish, expose, user, @@ -156,12 +155,15 @@ mkContainer cid@(ContainerId hn _cn) h = Container where info = _dockerinfo $ hostInfo h' h' = h - -- expose propellor directory inside the container + -- Restart by default so container comes up on + -- boot or when docker is upgraded. + &^ restart RestartAlways + -- Expose propellor directory inside the container. & volume (localdir++":"++localdir) - -- name the container in a predictable way so we - -- and the user can easily find it later + -- Name the container in a predictable way so we + -- and the user can easily find it later. This property + -- comes last, so it cannot be overridden. & 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 @@ -220,7 +222,7 @@ dns = runProp "dns" hostname :: String -> Property hostname = runProp "hostname" --- | Set name for container. (Normally done automatically.) +-- | Set name of container. name :: String -> Property name = runProp "name" @@ -283,19 +285,19 @@ restart policy = runProp "restart" (serialize policy) where serialize NoRestart = "no" serialize (RestartOnFailure Nothing) = "on-failure" - serialize (RestartOnFailure n) = "on-failure:" ++ show n + serialize (RestartOnFailure (Just 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 +-- | 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. +-- +-- 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 too many restarts. data RestartPolicy = NoRestart | RestartOnFailure (Maybe Int) | RestartAlways -- | A container is identified by its name, and the host -- cgit v1.3-2-g0d8e From ac7b182b5a0f3711414757d05bb461385516e700 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:36:06 -0400 Subject: propellor spin --- src/Propellor/Property.hs | 10 +--------- src/Propellor/Property/Docker.hs | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 4b957317..ce825192 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 is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) +(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) infixl 1 & @@ -145,14 +145,6 @@ 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 b717fe19..0e71acd3 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 -- cgit v1.3-2-g0d8e From 8d353813bf1e4d0c64f33cf2beed0938eeca92b4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:39:29 -0400 Subject: Revert "propellor spin" This reverts commit ac7b182b5a0f3711414757d05bb461385516e700. --- src/Propellor/Property.hs | 10 +++++++++- src/Propellor/Property/Docker.hs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property.hs') 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 -- cgit v1.3-2-g0d8e From 26bef2486d27b2cde6feda633c6a7509675a3fe5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:42:34 -0400 Subject: Revert "Revert "propellor spin"" This reverts commit 8d353813bf1e4d0c64f33cf2beed0938eeca92b4. --- src/Propellor/Property.hs | 10 +--------- src/Propellor/Property/Docker.hs | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'src/Propellor/Property.hs') diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 4b957317..ce825192 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 is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) +(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) infixl 1 & @@ -145,14 +145,6 @@ 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 b717fe19..0e71acd3 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 -- cgit v1.3-2-g0d8e From e6924a894d32697747795bd78d7ee1cad92af5a7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:46:15 -0400 Subject: Revert "Revert "Revert "propellor spin""" This reverts commit 26bef2486d27b2cde6feda633c6a7509675a3fe5. --- src/Propellor/Property.hs | 10 +++++++++- src/Propellor/Property/Docker.hs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property.hs') 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 -- cgit v1.3-2-g0d8e