From 7f24020d963714dd8d4b624b0240fefcd81cc9e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 06:19:02 -0400 Subject: update --- .../type_level_privdata_availability_checking.mdwn | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/todo/type_level_privdata_availability_checking.mdwn b/doc/todo/type_level_privdata_availability_checking.mdwn index 7f02c700..cb0d157d 100644 --- a/doc/todo/type_level_privdata_availability_checking.mdwn +++ b/doc/todo/type_level_privdata_availability_checking.mdwn @@ -11,8 +11,8 @@ It would have one type-level function type instance HasPrivData "password" "foo.com" = Available -- ^ supposed to be type level strings -The file would generate instances of the type family or each available privdata -value. +The file would be generated with +instances of the type family for each available privdata value. `withPrivData` would use this type level function, and require it to return Availble. If it didn't, the type checker would blow up. @@ -23,12 +23,18 @@ may be tricky.) For this to work, `withPrivData` would need some interesting changes to its type signature, so that it has available the type level strings describing the privdata it's supposed to get. Is that practical? I think so, -actually.. +actually.. - withPrivData :: (HasPrivData source context) => source -> context -> (((PrivData -> Propellor Result) -> Propellor Result) -> Property i) -> Property HasInfo +Something like this, although my type-level comparison syntax may be off. -All that's needed is a way to provide a type level string from which a -string value can be extracted that has the same string as the type. IIRC, -that's supported by type level strings. + withPrivData :: (HasPrivData source context ~ Available) source -> context -> (((PrivData -> Propellor Result) -> Propellor Result) -> Property i) -> Property HasInfo + +All that's needed to use this is a way to provide a type level string from +which a string value can be extracted that has the same string as the type. +IIRC, that's supported by type level strings. + +But.. This may get tricky/unusable when source and context are constructed +based on data now, since the type-level source and context need to be +constructed at build time. --[[Joey]] -- cgit v1.3-2-g0d8e From 4992b53724d6c4dec3899cd6c52163b4548abd7c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 15:08:58 -0400 Subject: document status (cherry picked from commit 6d52245a574e65275f818d90839737f0074b045f) --- ...ent_2_5a1c0c54db25b039eda28e213e1e6263._comment | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_2_5a1c0c54db25b039eda28e213e1e6263._comment diff --git a/doc/todo/type_level_OS_requirements/comment_2_5a1c0c54db25b039eda28e213e1e6263._comment b/doc/todo/type_level_OS_requirements/comment_2_5a1c0c54db25b039eda28e213e1e6263._comment new file mode 100644 index 00000000..27aaf0cd --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_2_5a1c0c54db25b039eda28e213e1e6263._comment @@ -0,0 +1,43 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-03-08T18:44:25Z" + content=""" +I've made a typed-os-requirements branch that has type-level +OS lists implemented. + +For example: + + *Propellor.Types.OS.TypeLevel> let l = (debian `combineSupportedOS` freeBSD ) `intersectSupportedOS` unixlike + *Propellor.Types.OS.TypeLevel> l + OSList [OSDebian,OSFreeBSD] + *Propellor.Types.OS.TypeLevel> :t l + l :: OSList + (IntersectOSList + '[] '['OSDebian, 'OSFreeBSD] '['OSDebian, 'OSBuntish, 'OSFreeBSD]) + +What this is lacking is type-level equality for OSList. +The complicated type above should be equivilant to `OSList '[OSDebian, OSFreeBSD]` + +So, this doesn't type check yet: + + foo :: OSList '[OSDebian, OSFreeBSD] + foo = (debian `combineSupportedOS` freeBSD ) `intersectSupportedOS` unixlike + + src/Propellor/Types/OS/Typelevel.hs:47:46: + Couldn't match expected type ‘IntersectOSList + '[] + '['OSDebian, 'OSFreeBSD] + '['OSDebian, 'OSBuntish, 'OSFreeBSD]’ + with actual type ‘'['OSDebian, 'OSFreeBSD]’ + In the expression: + (debian `combineSupportedOS` freeBSD) + `intersectSupportedOS` unixlike + In an equation for ‘foo’: + foo + = (debian `combineSupportedOS` freeBSD) + `intersectSupportedOS` unixlike + +Also, `intersectSupportedOS` should have an additional constraint, +to prevent it from generating an empty type-level list. +"""]] -- cgit v1.3-2-g0d8e From d91b189ceb5f1e264f7c7dcba128f17b7fe0bc20 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 17:09:24 -0400 Subject: add --- .../comment_3_124ceb79eaa4eacc9636147dde4c262c._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_3_124ceb79eaa4eacc9636147dde4c262c._comment diff --git a/doc/todo/type_level_OS_requirements/comment_3_124ceb79eaa4eacc9636147dde4c262c._comment b/doc/todo/type_level_OS_requirements/comment_3_124ceb79eaa4eacc9636147dde4c262c._comment new file mode 100644 index 00000000..230eccab --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_3_124ceb79eaa4eacc9636147dde4c262c._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-03-08T21:06:08Z" + content=""" +Asked about what I'm stuck on: + +"""]] -- cgit v1.3-2-g0d8e From 8b1601cc6a6e07e5010f9a231063630bb6595713 Mon Sep 17 00:00:00 2001 From: "mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" Date: Tue, 8 Mar 2016 21:15:34 +0000 Subject: Added a comment --- .../comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment new file mode 100644 index 00000000..3edd0eac --- /dev/null +++ b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 5" + date="2016-03-08T21:15:34Z" + content=""" +That sounds like a reasonable compromise; I can think of a few complicated scenarios which wouldn' +"""]] -- cgit v1.3-2-g0d8e From c6d7769b0e0b3a83f6b57a3b637cb8cfc339d121 Mon Sep 17 00:00:00 2001 From: "mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" Date: Tue, 8 Mar 2016 21:15:41 +0000 Subject: removed --- .../comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment deleted file mode 100644 index 3edd0eac..00000000 --- a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_69ec8232e2f444bbd8b6f0c4dca9ceec._comment +++ /dev/null @@ -1,8 +0,0 @@ -[[!comment format=mdwn - username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" - nickname="mithrandi" - subject="comment 5" - date="2016-03-08T21:15:34Z" - content=""" -That sounds like a reasonable compromise; I can think of a few complicated scenarios which wouldn' -"""]] -- cgit v1.3-2-g0d8e From 4481294c7fdbd1360ad271cebfa6312530398de4 Mon Sep 17 00:00:00 2001 From: "mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" Date: Tue, 8 Mar 2016 21:16:28 +0000 Subject: Added a comment --- .../comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment new file mode 100644 index 00000000..ef1ad173 --- /dev/null +++ b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 5" + date="2016-03-08T21:16:28Z" + content=""" +That sounds reasonable to me. One question, though; would this mean that if you commit stack.yaml to your repo (which I currently don't do), you have to have Propellor available on all the hosts you deploy to? +"""]] -- cgit v1.3-2-g0d8e From 6fbdabac68fa0b484b6c138043a7b5f82c0ca4a0 Mon Sep 17 00:00:00 2001 From: "mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" Date: Tue, 8 Mar 2016 21:16:30 +0000 Subject: Added a comment --- .../comment_6_73842a5ea0d791cd05621778803e0b69._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_73842a5ea0d791cd05621778803e0b69._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_73842a5ea0d791cd05621778803e0b69._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_73842a5ea0d791cd05621778803e0b69._comment new file mode 100644 index 00000000..c56d2b7c --- /dev/null +++ b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_73842a5ea0d791cd05621778803e0b69._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 6" + date="2016-03-08T21:16:30Z" + content=""" +That sounds reasonable to me. One question, though; would this mean that if you commit stack.yaml to your repo (which I currently don't do), you have to have Propellor available on all the hosts you deploy to? +"""]] -- cgit v1.3-2-g0d8e From 8e9e32c016e1573daee8e816329083a7a161815b Mon Sep 17 00:00:00 2001 From: "mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" Date: Tue, 8 Mar 2016 21:16:46 +0000 Subject: removed --- .../comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment deleted file mode 100644 index ef1ad173..00000000 --- a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_5_5aec2cca79e4ea7a40d17ce30c2d35a8._comment +++ /dev/null @@ -1,8 +0,0 @@ -[[!comment format=mdwn - username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" - nickname="mithrandi" - subject="comment 5" - date="2016-03-08T21:16:28Z" - content=""" -That sounds reasonable to me. One question, though; would this mean that if you commit stack.yaml to your repo (which I currently don't do), you have to have Propellor available on all the hosts you deploy to? -"""]] -- cgit v1.3-2-g0d8e From 71c29690ee970d1319f8221311b8b5224f1c5397 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 17:19:57 -0400 Subject: comment --- .../comment_4_8d14bbbec4e219015a80f80bf6124181._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_4_8d14bbbec4e219015a80f80bf6124181._comment diff --git a/doc/todo/type_level_OS_requirements/comment_4_8d14bbbec4e219015a80f80bf6124181._comment b/doc/todo/type_level_OS_requirements/comment_4_8d14bbbec4e219015a80f80bf6124181._comment new file mode 100644 index 00000000..5db7b68b --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_4_8d14bbbec4e219015a80f80bf6124181._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2016-03-08T21:19:01Z" + content=""" +Ok, got intersectSupportedOS fixed. + + *Propellor.Types.OS.TypeLevel> :t (intersectSupportedOS (combineSupportedOS freeBSD debian) debian) + (intersectSupportedOS (combineSupportedOS freeBSD debian) debian) :: OSList '['OSDebian] + +So, the type level OS lists are ready, on to the next step ... eventually ... +"""]] -- cgit v1.3-2-g0d8e From f7b095b855d4be32fb2591fa9c06292d300081eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 18:00:00 -0400 Subject: update --- doc/todo/type_level_OS_requirements.mdwn | 7 ++----- .../comment_5_35dbd3a2eb073f4c456ac567aec569bd._comment | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 doc/todo/type_level_OS_requirements/comment_5_35dbd3a2eb073f4c456ac567aec569bd._comment diff --git a/doc/todo/type_level_OS_requirements.mdwn b/doc/todo/type_level_OS_requirements.mdwn index 65e6099f..784f69fb 100644 --- a/doc/todo/type_level_OS_requirements.mdwn +++ b/doc/todo/type_level_OS_requirements.mdwn @@ -12,10 +12,7 @@ yields a `Property i '[Debian]` -- the intersection of the OS's supported by the combined properties. And, combining two properties that demand different OS's would need to be a -type error. Can a type level function combine two types successfully, and -fail to combine two others somehow? Don't know. Maybe combine to an -IncoherentOS and don't allow a `Property i IncoherentOS` to be used in a -Host? +type error. Another kind of property combination would be to glue two properties that support different OS's together, yielding a property that supports both, @@ -35,7 +32,7 @@ the OS of the Host is indeterminite. Which would be fixed by using the `os` property to specify. On the other hand, if a Host's list of properties yields a single OS -(or perhaps no OS requirement), the type needs to be just `Host`. +the type needs to be just `Host`. After all, propellor operates on a `[Host]`; if we had `Host OS`, the list couldn't contain host's with different OS's. diff --git a/doc/todo/type_level_OS_requirements/comment_5_35dbd3a2eb073f4c456ac567aec569bd._comment b/doc/todo/type_level_OS_requirements/comment_5_35dbd3a2eb073f4c456ac567aec569bd._comment new file mode 100644 index 00000000..e95a88c8 --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_5_35dbd3a2eb073f4c456ac567aec569bd._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2016-03-08T21:56:26Z" + content=""" +I got it to throw a nice type error when intersection of two OS lists +yields an empty list: + + Couldn't match type ‘'CannotCombineOS’ with ‘'CanCombineOS’ + Expected type: 'CanCombineOS + Actual type: CannotCombineOS '['OSDebian] '['OSFreeBSD] '[] + In the expression: intersectSupportedOS debian freeBSD + +I think the next step would be actually adding the OSList to Property +and making combining properties combine their OS lists at the type level. +"""]] -- cgit v1.3-2-g0d8e From a11a667fbe17c116f99306c10b216643c0ad468e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 18:02:15 -0400 Subject: comment --- .../comment_6_36e0123127b60d1d9e9cf38783dc0c2c._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_36e0123127b60d1d9e9cf38783dc0c2c._comment diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_36e0123127b60d1d9e9cf38783dc0c2c._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_36e0123127b60d1d9e9cf38783dc0c2c._comment new file mode 100644 index 00000000..28d39bc0 --- /dev/null +++ b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_6_36e0123127b60d1d9e9cf38783dc0c2c._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 6""" + date="2016-03-08T22:00:37Z" + content=""" +When stack.yaml exists, using --spin would need to get stack installed +on the remote host, and use it to build propellor. Much as --spin currently +gets cabal and ghc installed and uses them to build. +"""]] -- cgit v1.3-2-g0d8e From 70f9cc11ff70ef9bdab5756ce10d15c9ae3f71a8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 18:28:00 -0400 Subject: note --- doc/todo/type_level_OS_requirements.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/todo/type_level_OS_requirements.mdwn b/doc/todo/type_level_OS_requirements.mdwn index 784f69fb..a73ac13b 100644 --- a/doc/todo/type_level_OS_requirements.mdwn +++ b/doc/todo/type_level_OS_requirements.mdwn @@ -44,4 +44,12 @@ the Propellor Result extracted from the resulting single property. This is somewhat similar to [[type_level_port_conflict_detection]]. +---- + +Note that propellor needs to remain buildable with Debian stable's +ghc 7.6.3. Stuff like type level lists needs a newer ghc. So any work on +this may need to be deferred merging into propellor mainline unless it can +be made to build with the old ghc (even if perhaps not doing the full type +checking of OS's there). + --[[Joey]] -- cgit v1.3-2-g0d8e From bcc3c4daa3239538fb64a3895b35f337af149f84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:34:33 -0400 Subject: update --- doc/todo/type_level_OS_requirements.mdwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/todo/type_level_OS_requirements.mdwn b/doc/todo/type_level_OS_requirements.mdwn index a73ac13b..3cd6e97d 100644 --- a/doc/todo/type_level_OS_requirements.mdwn +++ b/doc/todo/type_level_OS_requirements.mdwn @@ -47,9 +47,7 @@ This is somewhat similar to [[type_level_port_conflict_detection]]. ---- Note that propellor needs to remain buildable with Debian stable's -ghc 7.6.3. Stuff like type level lists needs a newer ghc. So any work on -this may need to be deferred merging into propellor mainline unless it can -be made to build with the old ghc (even if perhaps not doing the full type -checking of OS's there). +ghc 7.6.3. I was able to get the type level OS implementation backported to +work with that version, with some added ugliness. --[[Joey]] -- cgit v1.3-2-g0d8e From 6991fdd75285e4d2173d92251780bec02fd91660 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:50:11 -0400 Subject: fix to build with ghc 7.6.3 --- src/Propellor/Property/FreeBSD/Pkg.hs | 2 +- src/Propellor/Property/FreeBSD/Poudriere.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/FreeBSD/Pkg.hs b/src/Propellor/Property/FreeBSD/Pkg.hs index 913710f7..6bbd2570 100644 --- a/src/Propellor/Property/FreeBSD/Pkg.hs +++ b/src/Propellor/Property/FreeBSD/Pkg.hs @@ -2,7 +2,7 @@ -- -- FreeBSD pkgng properties -{-# Language ScopedTypeVariables, GeneralizedNewtypeDeriving #-} +{-# Language ScopedTypeVariables, GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Propellor.Property.FreeBSD.Pkg where diff --git a/src/Propellor/Property/FreeBSD/Poudriere.hs b/src/Propellor/Property/FreeBSD/Poudriere.hs index 7ed7f59e..5467c668 100644 --- a/src/Propellor/Property/FreeBSD/Poudriere.hs +++ b/src/Propellor/Property/FreeBSD/Poudriere.hs @@ -2,7 +2,7 @@ -- -- FreeBSD Poudriere properties -{-# Language GeneralizedNewtypeDeriving #-} +{-# Language GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Propellor.Property.FreeBSD.Poudriere where -- cgit v1.3-2-g0d8e From 67054800d4dccdb6634b723652257b3a6d1538cf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:54:43 -0400 Subject: when run w/o parameters as root, update from git and build Got lost in recent changes and broke the cron job. --- src/Propellor/CmdLine.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 1761a11e..ee057d05 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -122,11 +122,10 @@ defaultMain hostlist = withConcurrentOutput $ do go cr cmdline@(Spin hs mrelay) = buildFirst cr cmdline $ do unless (isJust mrelay) commitSpin forM_ hs $ \hn -> withhost hn $ spin mrelay hn - go cr (Run hn) = fetchFirst $ - ifM ((==) 0 <$> getRealUserID) - ( runhost hn - , go cr (Spin [hn] Nothing) - ) + go cr cmdline@(Run hn) = ifM ((==) 0 <$> getRealUserID) + ( updateFirst cr cmdline $ runhost hn + , fetchFirst $ go cr (Spin [hn] Nothing) + ) go cr cmdline@(SimpleRun hn) = forceConsole >> fetchFirst (buildFirst cr cmdline (runhost hn)) -- When continuing after a rebuild, don't want to rebuild again. -- cgit v1.3-2-g0d8e From 8760c6162aae4c67a90986eda732412974cfaf76 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:59:04 -0400 Subject: test --- joeyconfig.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joeyconfig.hs b/joeyconfig.hs index bab8f466..1d9798ea 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -45,7 +45,7 @@ main = defaultMain hosts -- / \___-=O`/|O`/__| (____.' hosts :: [Host] -- * \ | | '--------' hosts = -- (o) ` [ darkstar - , gnu + , gnu , clam , mayfly , oyster -- cgit v1.3-2-g0d8e From cc7b21ec7749a6458c303caa5a9bec27f93565d4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Mar 2016 00:03:51 -0400 Subject: avoid error message when dpkg-parsechangelog is not installed --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d1809458..a9ad2b84 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CABAL?=cabal -DATE := $(shell dpkg-parsechangelog | grep Date | cut -d " " -f2-) +DATE := $(shell dpkg-parsechangelog 2>/dev/null | grep Date | cut -d " " -f2-) # this target is provided (and is first) to keep old versions of the # propellor cron job working, and will eventually be removed -- cgit v1.3-2-g0d8e From 6355696b84b0d1a6d1e75fc871109ae6b5c3d85e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Mar 2016 00:20:28 -0400 Subject: reorder --- debian/changelog | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 462cad65..2dc562bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,28 +1,29 @@ propellor (2.17.0) UNRELEASED; urgency=medium - * Apt.upgrade: Run dpkg --configure -a first, to recover from - interrupted upgrades. - * Apt: Add safeupgrade. - * Avoid repeated re-building on systems such as FreeBSD where building - re-links the binary even when there are no changes. + * Added initial support for FreeBSD. + Thanks, Evan Cofsky. + * Added Propellor.Property.ZFS. + Thanks, Evan Cofsky. * Firewall: Reorganized Chain data type. (API change) Thanks, Félix Sipma. * Firewall: Separated Table and Target (API change) Thanks, Félix Sipma. + * Ssh: change type of listenPort from Int to Port (API change) + Thanks, Félix Sipma. * Firewall: add TCPFlag, Frequency, TCPSyn, ICMPTypeMatch, NatDestination Thanks, Félix Sipma. + * Network: Filter out characters not allowed in interfaces.d files. + Thanks, Félix Sipma. + * Apt.upgrade: Run dpkg --configure -a first, to recover from + interrupted upgrades. + * Apt: Add safeupgrade. + * Force ssh, scp, and git commands to be run in the foreground. + Should fix intermittent hangs of propellor --spin. + * Avoid repeated re-building on systems such as FreeBSD where building + re-links the binary even when there are no changes. * Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, which modified the locale.gen file and sometimes caused the property to need to make changes every time. - * Force ssh, scp, and git commands to be run in the foreground. - * Network: Filter out characters not allowed in interfaces.d files. - Thanks, Félix Sipma. - * Ssh: hange type of listenPort from Int to Port (API change) - Thanks, Félix Sipma. - * Added initial support for FreeBSD. - Thanks, Evan Cofsky. - * Added Propellor.Property.ZFS. - Thanks, Evan Cofsky. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 -- cgit v1.3-2-g0d8e From f045116b618e255c583376447be635c245d63909 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Mar 2016 01:29:37 -0400 Subject: Speed up propellor's build of itself, by asking cabal to only build the propellor-config binary and not all the libraries. This is a super speedup! --- debian/changelog | 2 ++ src/Propellor/Bootstrap.hs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2dc562bf..a8fb5ecc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ propellor (2.17.0) UNRELEASED; urgency=medium * Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, which modified the locale.gen file and sometimes caused the property to need to make changes every time. + * Speed up propellor's build of itself, by asking cabal to only build + the propellor-config binary and not all the libraries. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 11e59e6f..69eee66c 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -34,7 +34,7 @@ checkBinaryCommand = "if test -x ./propellor && ! ./propellor --check; then " ++ buildCommand :: ShellCommand buildCommand = intercalate " && " [ "cabal configure" - , "cabal build" + , "cabal build propellor-config" , "ln -sf dist/build/propellor-config/propellor-config propellor" ] @@ -141,7 +141,7 @@ build :: IO Bool build = catchBoolIO $ do make "dist/setup-config" ["propellor.cabal"] $ cabal ["configure"] - unlessM (cabal ["build"]) $ do + unlessM (cabal ["build", "propellor-config"]) $ do void $ cabal ["configure"] unlessM (cabal ["build"]) $ error "cabal build failed" -- cgit v1.3-2-g0d8e From 29c6dcda77ee8348f7c8b292d61d363a6d699e26 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Mar 2016 11:04:59 -0400 Subject: comment --- ...1_507e3b74c2a3b8f41da5d3eddf197c6f._comment.swp | Bin 0 -> 12288 bytes ...ent_6_b10cb4445eb2519c8b3f7f080c975113._comment | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/.comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment.swp create mode 100644 doc/todo/type_level_OS_requirements/comment_6_b10cb4445eb2519c8b3f7f080c975113._comment diff --git a/doc/todo/type_level_OS_requirements/.comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment.swp b/doc/todo/type_level_OS_requirements/.comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment.swp new file mode 100644 index 00000000..79380a08 Binary files /dev/null and b/doc/todo/type_level_OS_requirements/.comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment.swp differ diff --git a/doc/todo/type_level_OS_requirements/comment_6_b10cb4445eb2519c8b3f7f080c975113._comment b/doc/todo/type_level_OS_requirements/comment_6_b10cb4445eb2519c8b3f7f080c975113._comment new file mode 100644 index 00000000..9741de20 --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_6_b10cb4445eb2519c8b3f7f080c975113._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 6""" + date="2016-03-09T15:01:05Z" + content=""" +I've added a prototype of `ensureProperty` that enforces at the type level +that the property it runs will work on an OS that's passed to it. + +It was easier than I thought; I didn't turn out to need reification. Just +pass in the outer OS: + + ensureProperty + :: (CannotCombineOS outeros inneros (IntersectOSList outeros inneros) ~ CanCombineOS) + => OSList outeros + -> Property (OSList inneros) + -> IO () + ensureProperty outeros (Property inneros a) = a + +At this point, I'm confident this can be rolled out into propellor; +there should be no big bumps in the road ahead. +"""]] -- cgit v1.3-2-g0d8e From 2d72dcd2545a295b8b34dce0f5b7950ff9f7de36 Mon Sep 17 00:00:00 2001 From: "evan@0e4cded17eab71af967a38b123fbc211cf215421" Date: Thu, 10 Mar 2016 03:24:47 +0000 Subject: Added a comment: Amazonka --- .../comment_5_ace17433647f7b2adbce27261cf4cd33._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/todo/HostingProvider_for_AWS/comment_5_ace17433647f7b2adbce27261cf4cd33._comment diff --git a/doc/todo/HostingProvider_for_AWS/comment_5_ace17433647f7b2adbce27261cf4cd33._comment b/doc/todo/HostingProvider_for_AWS/comment_5_ace17433647f7b2adbce27261cf4cd33._comment new file mode 100644 index 00000000..da9324ca --- /dev/null +++ b/doc/todo/HostingProvider_for_AWS/comment_5_ace17433647f7b2adbce27261cf4cd33._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="evan@0e4cded17eab71af967a38b123fbc211cf215421" + nickname="evan" + subject="Amazonka" + date="2016-03-10T03:24:47Z" + content=""" +[Amazonka](http://brendanhay.nz/amazonka-doc/amazonka-ec2/index.html) is really thorough, and I think I'm going to start writing some properties to spin up some things tomorrow. I wrote some PKI stuff today for work so we can start launching things without SSH open to the world, and this is definitely a good next step. + +I've already got a hand-mashed set of subnets I'm really itching to automate. + + + +Thanks +"""]] -- cgit v1.3-2-g0d8e From 6805735e05ee48ab818803b0b7252e638a54eb94 Mon Sep 17 00:00:00 2001 From: "evan@0e4cded17eab71af967a38b123fbc211cf215421" Date: Thu, 10 Mar 2016 16:35:55 +0000 Subject: --- doc/todo/SDN_Configuration.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/todo/SDN_Configuration.mdwn diff --git a/doc/todo/SDN_Configuration.mdwn b/doc/todo/SDN_Configuration.mdwn new file mode 100644 index 00000000..f87075f1 --- /dev/null +++ b/doc/todo/SDN_Configuration.mdwn @@ -0,0 +1 @@ +I think this may be a bit more of a back-burner thing, but with virtual networking and software-defined networking, like what OpenStack, AWS VPC, and others have, adding another type at the same level as Host currently, but for networks might be an interesting thing to consider ways of doing. -- cgit v1.3-2-g0d8e From bb3a6f9a10e5e4ee5bf27e64920904ea5dce5046 Mon Sep 17 00:00:00 2001 From: "evan@0e4cded17eab71af967a38b123fbc211cf215421" Date: Fri, 11 Mar 2016 14:14:51 +0000 Subject: Added a comment: In Fact Amazonka is Fairly Epic --- .../comment_6_be3608729f362cdf5fc0a338c4a07f67._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/HostingProvider_for_AWS/comment_6_be3608729f362cdf5fc0a338c4a07f67._comment diff --git a/doc/todo/HostingProvider_for_AWS/comment_6_be3608729f362cdf5fc0a338c4a07f67._comment b/doc/todo/HostingProvider_for_AWS/comment_6_be3608729f362cdf5fc0a338c4a07f67._comment new file mode 100644 index 00000000..ceaecaed --- /dev/null +++ b/doc/todo/HostingProvider_for_AWS/comment_6_be3608729f362cdf5fc0a338c4a07f67._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="evan@0e4cded17eab71af967a38b123fbc211cf215421" + nickname="evan" + subject="In Fact Amazonka is Fairly Epic" + date="2016-03-11T14:14:51Z" + content=""" +I'm going to start working with it outside Propellor for a bit to configure our infrastructure, then I think we can really have a good sense of what we can do to start moving bits back into Propellor. To give an idea of just how much is going on, even just building amazonka-ec2 takes around 30 minutes on my laptop. A lot of it is (rightly-so) auto-generated from the AWS API descriptions, and it relies heavily on lenses. One of my goals with my current work is getting our AWS infrastructure built using Amazonka, and with a similar model as Propellor, and I think that'll ultimately be something we'll be able to merge (with a lot of merging effort of course). +"""]] -- cgit v1.3-2-g0d8e From 32066e51c8d179bfbe900d501be2b1545e44e60e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Mar 2016 11:31:23 -0400 Subject: fix clone command --- doc/components.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/components.mdwn b/doc/components.mdwn index c7b0e98b..801bb6bf 100644 --- a/doc/components.mdwn +++ b/doc/components.mdwn @@ -33,7 +33,7 @@ install propellor, and then copy the two files from the [mininalconfig branch](http://source.propellor.branchable.com/?p=source.git;a=tree;h=refs/heads/minimalconfig;hb=refs/heads/minimalconfig), or clone it: - git clone ssh://b-propellor@propellor.branchable.com/propellor.branchable.com .propellor --branch minimalconfig --single-branch + git clone git://propellor.branchable.com/ .propellor --branch minimalconfig --single-branch In this configuration, when propellor is deploying itself to a new host, it will automatically install the version of the propellor library -- cgit v1.3-2-g0d8e From 38f17eda16c641fd0f0e2ff16f1064341e276be0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Mar 2016 12:34:32 -0400 Subject: link --- .../comment_7_a77278f07bc0047d1f25c3d6c294b475._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/HostingProvider_for_AWS/comment_7_a77278f07bc0047d1f25c3d6c294b475._comment diff --git a/doc/todo/HostingProvider_for_AWS/comment_7_a77278f07bc0047d1f25c3d6c294b475._comment b/doc/todo/HostingProvider_for_AWS/comment_7_a77278f07bc0047d1f25c3d6c294b475._comment new file mode 100644 index 00000000..1d196a51 --- /dev/null +++ b/doc/todo/HostingProvider_for_AWS/comment_7_a77278f07bc0047d1f25c3d6c294b475._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 7""" + date="2016-03-15T16:34:22Z" + content=""" + +"""]] -- cgit v1.3-2-g0d8e From d88b62c16cc0bbaacfb1619e7ee4eb52344e133c Mon Sep 17 00:00:00 2001 From: "evan@0e4cded17eab71af967a38b123fbc211cf215421" Date: Thu, 17 Mar 2016 03:31:57 +0000 Subject: Added a comment: Buntish Releases --- .../comment_7_a760b1a3b62f9bd8fd61eb5ec2ff216f._comment | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_7_a760b1a3b62f9bd8fd61eb5ec2ff216f._comment diff --git a/doc/todo/type_level_OS_requirements/comment_7_a760b1a3b62f9bd8fd61eb5ec2ff216f._comment b/doc/todo/type_level_OS_requirements/comment_7_a760b1a3b62f9bd8fd61eb5ec2ff216f._comment new file mode 100644 index 00000000..1b649fc9 --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_7_a760b1a3b62f9bd8fd61eb5ec2ff216f._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="evan@0e4cded17eab71af967a38b123fbc211cf215421" + nickname="evan" + subject="Buntish Releases" + date="2016-03-17T03:31:57Z" + content=""" +I just came across another issue where the Buntish release string made a difference. I'll open a PR tomorrow sometime to show what I did (hardcoded) and maybe we can think of something cleverer using the typesystem, too. + +Thanks! +"""]] -- cgit v1.3-2-g0d8e From 50ce8694d62548321ad5b85681bd233d8f448806 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Mar 2016 13:45:16 -0400 Subject: comment --- ...ent_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment diff --git a/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment b/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment new file mode 100644 index 00000000..6a3b15c0 --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment @@ -0,0 +1,45 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 7""" + date="2016-03-17T17:30:44Z" + content=""" +This looks to be adding a new type parameter: + +`Property NoInfo DebianOnly` + +So does [[type_level_resource_conflict_detection|type_level_port_conflict_detection]]. + +Would it make sense to include both targeted OS's and used resources in the +same list of types? Otherwise, we end up with 4 type parameters, which is +increasingly a mouthful to write: + +`Property NoInfo DebianOnly '[]` + +Since most properties use no ports or other resources, combining the +resources lets type alises like DebianOnly be all that needs to be +specified: + +`Property NoInfo DebianOnly` + +When there is a resource, can use `':` to add it to the list: + +`Property NoInfo (Port 80 ': Port 443 ': DebianOnly)` + +Seems reasonable. The implementation of combining such type lists may get +complicated, because there will be different rules for target OS's vs +resources. + +---- + +Could also move the NoInfo|HasInfo into the type list. A list without +HasInfo would be used instead of an explicit NoInfo, so: + +`Property (HasInfo ': DebianOnly)` + +Hmm, this should also allow ensureProperty to be used on Property HasInfo. +Because the new version of ensureProperty has access to the type list of the +outer property, it could just enforce that, when the inner property HasInfo, +so does the outer property. + +Cool! +"""]] -- cgit v1.3-2-g0d8e From a0d01b8ad22cab75496c1b2fce4157309bc3222a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Mar 2016 16:08:01 -0400 Subject: correct --- .../comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment b/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment index 6a3b15c0..4bc3dfbb 100644 --- a/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment +++ b/doc/todo/type_level_OS_requirements/comment_7_6fd5354f19ec624d3eaa1c5eb427ebed._comment @@ -36,10 +36,4 @@ HasInfo would be used instead of an explicit NoInfo, so: `Property (HasInfo ': DebianOnly)` -Hmm, this should also allow ensureProperty to be used on Property HasInfo. -Because the new version of ensureProperty has access to the type list of the -outer property, it could just enforce that, when the inner property HasInfo, -so does the outer property. - -Cool! """]] -- cgit v1.3-2-g0d8e From 37d1201b2ecbc3b7872943bb3f30df0c9add34d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Mar 2016 16:32:47 -0400 Subject: propellor spin --- joeyconfig.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joeyconfig.hs b/joeyconfig.hs index 1d9798ea..327c268e 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -143,7 +143,7 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64" mayfly :: Host mayfly = standardSystem "mayfly.kitenet.net" (Stable "jessie") "amd64" [ "Scratch VM. Contents can change at any time!" ] - & ipv4 "104.167.118.15" + & ipv4 "167.88.36.193" & CloudAtCost.decruft & Apt.unattendedUpgrades -- cgit v1.3-2-g0d8e -- cgit v1.3-2-g0d8e -- cgit v1.3-2-g0d8e -- cgit v1.3-2-g0d8e -- cgit v1.3-2-g0d8e -- cgit v1.3-2-g0d8e From ae5208110ea48e747112e47478d430ea93cd4e15 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Mar 2016 23:05:09 -0400 Subject: Tor.named: Fix bug that sometimes caused the property to fail the first time, though retrying succeeded. May have only been a problem on debian stable, the /var/lib/tor/keys/ was not created by installing the package. --- debian/changelog | 2 ++ src/Propellor/Property/Tor.hs | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a8fb5ecc..b3f19cbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ propellor (2.17.0) UNRELEASED; urgency=medium need to make changes every time. * Speed up propellor's build of itself, by asking cabal to only build the propellor-config binary and not all the libraries. + * Tor.named: Fix bug that sometimes caused the property to fail the first + time, though retrying succeeded. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index e5fcdaa4..f7cb6c89 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -54,10 +54,20 @@ named n = configured [("Nickname", n')] torPrivKey :: Context -> Property HasInfo torPrivKey context = f `File.hasPrivContent` context `onChange` File.ownerGroup f user (userGroup user) - -- install tor first, so the directory exists with right perms - `requires` Apt.installed ["tor"] + `requires` torPrivKeyDirExists where - f = "/var/lib/tor/keys/secret_id_key" + f = torPrivKeyDir "secret_id_key" + +torPrivKeyDirExists :: Property NoInfo +torPrivKeyDirExists = File.dirExists torPrivKeyDir + `onChange` setperms + `requires` installed + where + setperms = File.ownerGroup torPrivKeyDir user (userGroup user) + `before` File.mode torPrivKeyDir 0O2700 + +torPrivKeyDir :: FilePath +torPrivKeyDir = "/var/lib/tor/keys" -- | A tor server (bridge, relay, or exit) -- Don't use if you just want to run tor for personal use. -- cgit v1.3-2-g0d8e From 2563624a77b4058d6b96ce0f099b2bee476fe359 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Mar 2016 23:07:47 -0400 Subject: propellor spin --- src/Propellor/Property/Tor.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index f7cb6c89..0c040f95 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -73,9 +73,13 @@ torPrivKeyDir = "/var/lib/tor/keys" -- Don't use if you just want to run tor for personal use. server :: Property NoInfo server = configured [("SocksPort", "0")] - `requires` Apt.installed ["tor", "ntp"] + `requires` installed + `requires` Apt.installed ["ntp"] `describe` "tor server" +installed :: Property NoInfo +installed = Apt.installed ["tor"] + -- | Specifies configuration settings. Any lines in the config file -- that set other values for the specified settings will be removed, -- while other settings are left as-is. Tor is restarted when -- cgit v1.3-2-g0d8e From 527e813bea1afb5f3146285c19741583b207b256 Mon Sep 17 00:00:00 2001 From: "evan@0e4cded17eab71af967a38b123fbc211cf215421" Date: Sat, 19 Mar 2016 14:51:51 +0000 Subject: From GH PR #13 --- doc/todo/OpenVPN___40__PR___35__13__41__.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/todo/OpenVPN___40__PR___35__13__41__.mdwn diff --git a/doc/todo/OpenVPN___40__PR___35__13__41__.mdwn b/doc/todo/OpenVPN___40__PR___35__13__41__.mdwn new file mode 100644 index 00000000..3847b31c --- /dev/null +++ b/doc/todo/OpenVPN___40__PR___35__13__41__.mdwn @@ -0,0 +1,20 @@ +> Is the ghc ppa needed past 12.04LTS? Past that version, they seem to +> have ghc 7.6.3 or newer, which is the current target version as it's the +> version in debian stable. If only specific ubuntu versions need the ghc +> ppa it would be best to avoid using it on newer ones. + +Oh! I hadn't realized 7.6.3 was the target, so I upgraded to 7.10.3 (which is what I've been using for things). I can definitely try a spin without it. I can't remember why I thought 7.6.3 was failing there but I'll definitely dig into it. + +> Even type aliases +> would be an improvement but probably newtypes or ADTs would improve on +> it. Also there may be some overlap with typees in Propellor.Property.Firewall + +Oh yes, definitely. I'll take a pass at that too, and dig into Firewall to see what's there. + +> Isn't Property HasInfo a shorter way to write that? I'm somewhat +> surprised you arrived at the partially applied type family there; ghc +> normally tells you the simplified type. + + CombinedType (Property NoInfo) (Property HasInfo) + +That's an excellent question. I think ultimately I tried a type hole to find out what I was missing, and that's what it came up with, but it also might be differences in ghc versions I stumbled into. I'll give it a try with 7.6.3. I'm using Trusty 14.04.4 for the project this is for. -- cgit v1.3-2-g0d8e From 6789411e43a451aeb2246d4b686a7b37097b95df Mon Sep 17 00:00:00 2001 From: "arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" Date: Sat, 19 Mar 2016 17:52:05 +0000 Subject: Added a comment: Spinning hosts in parallel --- .../comment_1_1976b145c519b575c1b0454611036055._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/automated_spins/comment_1_1976b145c519b575c1b0454611036055._comment diff --git a/doc/automated_spins/comment_1_1976b145c519b575c1b0454611036055._comment b/doc/automated_spins/comment_1_1976b145c519b575c1b0454611036055._comment new file mode 100644 index 00000000..24298db9 --- /dev/null +++ b/doc/automated_spins/comment_1_1976b145c519b575c1b0454611036055._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" + nickname="arnaud" + subject="Spinning hosts in parallel" + date="2016-03-19T17:52:04Z" + content=""" +I just noticed the existence of this conductor property, which seems really interesting. I was trying to understand if and how it would be possible to spinning hosts in parallel. This could be done either as part of a conductor's run, e.g. by traversing the graph in parallel, or from command-line. It seems to me I could use directly `spin` or `spin'` functions to do that from forked threads or processes, with the master process doing the spin commit, but I may be overlooking some potential issues... +"""]] -- cgit v1.3-2-g0d8e From 8ecaa473156a847c343b7356c5a7a146d7a73176 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 Mar 2016 14:48:37 -0400 Subject: comment --- ...ent_9_8d2153620518295f33b83f1506441fdd._comment | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/todo/type_level_OS_requirements/comment_9_8d2153620518295f33b83f1506441fdd._comment diff --git a/doc/todo/type_level_OS_requirements/comment_9_8d2153620518295f33b83f1506441fdd._comment b/doc/todo/type_level_OS_requirements/comment_9_8d2153620518295f33b83f1506441fdd._comment new file mode 100644 index 00000000..6f4128e2 --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_9_8d2153620518295f33b83f1506441fdd._comment @@ -0,0 +1,23 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 9""" + date="2016-03-19T18:35:20Z" + content=""" +I'm currently using a simple sum type to describe the target OS: + + data OS = OSDebian | OSBuntish | OSFreeBSD + +This could in theory specify much more information about the +OS version and architecture. +Even type-level strings could be used to include release names. + +But, the old version of ghc being targeted doesn't have the nice +Data.Type.Equality stuff; I had to implement my own clumsily +and it would quickly hit a combinatorial explosion with more data. + +(There may be a better way than the way I found which works back to ghc 7.6.3.) + +Of course, we can always add more detail later. Since type aliases are +used, `Propety Debian` which only specifies `OSDebian` now, could easily +be changed at some point to specify `OSDebian AnyVersion AnyArch`. +"""]] -- cgit v1.3-2-g0d8e From 8385201fde44447289b054754a422d58bf16ae10 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 Mar 2016 15:01:34 -0400 Subject: comment --- ...ent_2_d0b3cfce5e37727f5b17c14d0f4214d2._comment | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/automated_spins/comment_2_d0b3cfce5e37727f5b17c14d0f4214d2._comment diff --git a/doc/automated_spins/comment_2_d0b3cfce5e37727f5b17c14d0f4214d2._comment b/doc/automated_spins/comment_2_d0b3cfce5e37727f5b17c14d0f4214d2._comment new file mode 100644 index 00000000..c95ae691 --- /dev/null +++ b/doc/automated_spins/comment_2_d0b3cfce5e37727f5b17c14d0f4214d2._comment @@ -0,0 +1,27 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-03-19T18:49:26Z" + content=""" +Yes, that was the main reason to add +[Propellor.Property.Concurrent](http://hackage.haskell.org/package/propellor-2.16.0/docs/Propellor-Property-Concurrent.html) + +It should be able to parallelize any properties using the combinators in +there. Including `Propellor.Property.Conductor.conducts` + +For example: + + conducts hostfoo `concurrently` conducts hostbar `concurrently` conducts hostbaz + +Or, something like this to conduct a whole list of hosts in parallel +(have not tried to compile it, may need minor tweaking): + + concurrentList (pure 10) "conduct web servers in parallel" $ + PropList $ map toProp $ conduct webservers + + webservers :: [Host] + +Note that concurrent output will be serialized, so you'll probably see propellor +running live on the first host and then the ones that were conducted in the +background will have their output dumped the console later on. +"""]] -- cgit v1.3-2-g0d8e From de494c032e1b69052b435c29ebf797b069a5a342 Mon Sep 17 00:00:00 2001 From: "arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" Date: Sat, 19 Mar 2016 22:10:42 +0000 Subject: Added a comment --- .../comment_3_31fee6824f4f22f8f4fc8e77bf8f8d69._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/automated_spins/comment_3_31fee6824f4f22f8f4fc8e77bf8f8d69._comment diff --git a/doc/automated_spins/comment_3_31fee6824f4f22f8f4fc8e77bf8f8d69._comment b/doc/automated_spins/comment_3_31fee6824f4f22f8f4fc8e77bf8f8d69._comment new file mode 100644 index 00000000..dd2e0986 --- /dev/null +++ b/doc/automated_spins/comment_3_31fee6824f4f22f8f4fc8e77bf8f8d69._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" + nickname="arnaud" + subject="comment 3" + date="2016-03-19T22:10:42Z" + content=""" +Nice! Need to revisit latest changes to propellor as I may be missing some really cool stuff... +"""]] -- cgit v1.3-2-g0d8e From 954cb12c520f166dd9afb028741f00d05e205a58 Mon Sep 17 00:00:00 2001 From: "arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" Date: Sun, 20 Mar 2016 11:03:01 +0000 Subject: Added a comment --- .../comment_4_0e6a73215c72286ef0053b5d762537ab._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/automated_spins/comment_4_0e6a73215c72286ef0053b5d762537ab._comment diff --git a/doc/automated_spins/comment_4_0e6a73215c72286ef0053b5d762537ab._comment b/doc/automated_spins/comment_4_0e6a73215c72286ef0053b5d762537ab._comment new file mode 100644 index 00000000..1a031e9c --- /dev/null +++ b/doc/automated_spins/comment_4_0e6a73215c72286ef0053b5d762537ab._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" + nickname="arnaud" + subject="comment 4" + date="2016-03-20T11:03:01Z" + content=""" +Is there a straightforward way to do that from command-line? +"""]] -- cgit v1.3-2-g0d8e From 686140b2c7abfaa71811b6295269233867fe7095 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Mar 2016 10:22:46 -0400 Subject: tag --- doc/todo/type_level_OS_requirements.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/type_level_OS_requirements.mdwn b/doc/todo/type_level_OS_requirements.mdwn index 65e6099f..d18f2351 100644 --- a/doc/todo/type_level_OS_requirements.mdwn +++ b/doc/todo/type_level_OS_requirements.mdwn @@ -48,3 +48,5 @@ the Propellor Result extracted from the resulting single property. This is somewhat similar to [[type_level_port_conflict_detection]]. --[[Joey]] + +[[!tag user/joey]] -- cgit v1.3-2-g0d8e From 80109620f6af779a2c58bc5766fb77301729f60f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Mar 2016 13:08:44 -0400 Subject: make more clear that propellor targets debian stable's ghc --- propellor.cabal | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/propellor.cabal b/propellor.cabal index 4e0e1db2..7b9b8885 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -38,10 +38,12 @@ Executable propellor Main-Is: wrapper.hs GHC-Options: -threaded -Wall -fno-warn-tabs Hs-Source-Dirs: src - Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5, - IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal, - containers (>= 0.5), network, async, time, mtl, transformers, - exceptions (>= 0.6), stm, text, unix + Build-Depends: + -- propellor needs to support the ghc shipped in Debian stable + base >= 4.5, base < 5, + MissingH, directory, filepath, IfElse, process, bytestring, hslogger, + unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async, + time, mtl, transformers, exceptions (>= 0.6), stm, text Executable propellor-config Main-Is: config.hs -- cgit v1.3-2-g0d8e