summaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
authorJoey Hess2017-07-15 14:20:38 -0400
committerJoey Hess2017-07-15 17:20:17 -0400
commit5d7bdcde02d667d3f191470c23f8512dcb14f9fa (patch)
tree0d9b4b5f626bb7fe5fc5809c2115b6e68812c290 /doc/todo
parent9a9fcc55fcdfd17b7e94e3bfd217c2526aceefcb (diff)
add Propellor.Property.Versioned
New module which allows different versions of a property or host to be written down in a propellor config file. Has many applications, including staged upgrades and rollbacks. Note that it currently only supports RevertableProperty that has the same metatypes for its setup and cleanup sides. And, each RevertableProperty in a version definition needs to have the same metatypes as the others too. I tried a couple of times to add support for differing metatypes, but it got beyond my avilities to do. This commit was sponsored by Jeff Goeke-Smith on Patreon.
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/differential_update_via_RevertableProperty.mdwn25
1 files changed, 8 insertions, 17 deletions
diff --git a/doc/todo/differential_update_via_RevertableProperty.mdwn b/doc/todo/differential_update_via_RevertableProperty.mdwn
index 6d65c916..3eb9bc7a 100644
--- a/doc/todo/differential_update_via_RevertableProperty.mdwn
+++ b/doc/todo/differential_update_via_RevertableProperty.mdwn
@@ -101,33 +101,23 @@ Is, perhaps:
data Version = A | B | C
deriving (Enum, Ord)
- foo :: Versioned Host
+ foo :: Versioned Hoso
foo = versionedHost "foo" $ do
ver A someprop
- <|> inVersion [B, C] otherprop
+ <|> othervers otherprop
ver A somerevertableprop
- ver [B, C] somethingelse
+ ver [B, C] newprop
That's ... pretty ok, would hit as least some of the use cases described
above. Seems to need a Reader+Writer monad to implement it,
without passing the Version around explicitly.
-Is it allowable for `somethingelse` to not be revertable?
+Is it allowable for `newprop` to not be revertable?
Once `foo` gets that property, it is never removed if we're moving only
-forwars. On the other hand, perhaps the user will want to roll back to
+forwards. On the other hand, perhaps the user will want to roll back to
version A. Allowing rollbacks seems good, so `inVersion` should only
accept `RevertableProperty`.
-Here's another situation where reversion is not needed:
-
- foo = versionedHost "foo" $ do
- ver A (someprop :: Property)
- <|> ver [B, C] (someprop :: Property)
-
-That feels like an edge case.. And the only way that propellor could tell
-reversion is not needed there is if it could compare the two sides of the
-`<|>`, and there's no Eq.
-
Another interesting case is this:
foo = versionedHost "foo" $ do
@@ -151,5 +141,6 @@ examples above. And that allows composition of properties with versioning:
someprop :: Versioned (Property DebianLike)
someprop = versionedProperty $ do
- ver A foo
- ver [B, C] bar
+ ver A foo <|> ver [B, C] bar
+
+> [[done]] in Propellor.Property.Versioned. --[[Joey]]