From 6a5cb3d43b79f72805de9b1e3469f2db9807f235 Mon Sep 17 00:00:00 2001 From: mitchellsalad Date: Fri, 24 Mar 2017 16:59:19 +0000 Subject: --- doc/forum/Manage_multiple_different_projects_with_propellor.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/forum/Manage_multiple_different_projects_with_propellor.mdwn (limited to 'doc') diff --git a/doc/forum/Manage_multiple_different_projects_with_propellor.mdwn b/doc/forum/Manage_multiple_different_projects_with_propellor.mdwn new file mode 100644 index 00000000..bcba383c --- /dev/null +++ b/doc/forum/Manage_multiple_different_projects_with_propellor.mdwn @@ -0,0 +1,7 @@ +Hi there, + +I've been tasked with investigating propellor as an alternative to Ansible. I'm a little bit confused about how one might go about managing a *single* project's hosts with propellor, without infecting the global propellor config. It seems that everything is concerned with the ~/.propellor repository. However, I don't want project A's hosts to know about project B's and vice versa. I'm sure I'm overlooking something obvious! + +Thanks very much! + +Mitchell -- cgit v1.3-2-g0d8e From f03ccd29779094190f3b6414e931ebc4ac798778 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 24 Mar 2017 14:09:50 -0400 Subject: add news item for propellor 4.0.2 --- doc/news/version_4.0.1.mdwn | 6 ------ doc/news/version_4.0.2.mdwn | 12 ++++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) delete mode 100644 doc/news/version_4.0.1.mdwn create mode 100644 doc/news/version_4.0.2.mdwn (limited to 'doc') diff --git a/doc/news/version_4.0.1.mdwn b/doc/news/version_4.0.1.mdwn deleted file mode 100644 index e870a510..00000000 --- a/doc/news/version_4.0.1.mdwn +++ /dev/null @@ -1,6 +0,0 @@ -propellor 4.0.1 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Fix build with pre-AMP ghc. - * Tor: Restart daemon after installing private key. - * Tor.named, Tor.torPrivKey: Include the new ed25519 public/private key - pair in addition to the old secret\_id\_key."""]] \ No newline at end of file diff --git a/doc/news/version_4.0.2.mdwn b/doc/news/version_4.0.2.mdwn new file mode 100644 index 00000000..b955c579 --- /dev/null +++ b/doc/news/version_4.0.2.mdwn @@ -0,0 +1,12 @@ +propellor 4.0.2 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Apt.mirror can be used to set the preferred apt mirror of a host, + overriding the default CDN. This info is used by + Apt.stdSourcesList and Sbuild.builtFor. + Thanks, Sean Whitton. + * Property.Partition: Update kpartx output parser, as its output format + changed around version 0.6. Both output formats are supported now. + * Fix bug when using setContainerProps with a chroot that prevented + properties added to a chroot that way from being seen when propellor + was running inside the chroot. This affected disk image creation, and + possibly other things that use chroots."""]] \ No newline at end of file -- cgit v1.3-2-g0d8e From 12fbce5422f015b3519a3ddaa3eceb3e291b2acd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 24 Mar 2017 14:16:43 -0400 Subject: response --- .../comment_1_dbad48163b2efd6434ea7c37a72dfd30._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/forum/Manage_multiple_different_projects_with_propellor/comment_1_dbad48163b2efd6434ea7c37a72dfd30._comment (limited to 'doc') diff --git a/doc/forum/Manage_multiple_different_projects_with_propellor/comment_1_dbad48163b2efd6434ea7c37a72dfd30._comment b/doc/forum/Manage_multiple_different_projects_with_propellor/comment_1_dbad48163b2efd6434ea7c37a72dfd30._comment new file mode 100644 index 00000000..7513cc09 --- /dev/null +++ b/doc/forum/Manage_multiple_different_projects_with_propellor/comment_1_dbad48163b2efd6434ea7c37a72dfd30._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-03-24T18:14:14Z" + content=""" +There did not used to be a good way to do that, but since propellor 3.2.3, +when you run eg "propellor --spin host", it first checks to see if there is +a `./config.hs` file, and if so, uses it instead of the user-global +`~/.propellor/config.hs`. + +So, just make different git repos for the different projects with propellor +`config.hs` files in them, and `cd` into the one you want to run before running +propellor. +"""]] -- cgit v1.3-2-g0d8e From b711f16d671f709c21873ff7b3c13a93995e62f9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 25 Mar 2017 17:09:24 -0400 Subject: todo --- doc/todo/property_to_install_propellor.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/todo/property_to_install_propellor.mdwn (limited to 'doc') diff --git a/doc/todo/property_to_install_propellor.mdwn b/doc/todo/property_to_install_propellor.mdwn new file mode 100644 index 00000000..25db8193 --- /dev/null +++ b/doc/todo/property_to_install_propellor.mdwn @@ -0,0 +1,14 @@ +This seems redundant, since propellor must be running to ensure such a +Property, but a Property to install propellor is useful when eg, creating a +disk image that itself will need to run propellor. --[[Joey]] + +Should support: + +* Cloning the git repo propellor is running in. (Using eg `hostChroot`) +* Cloning some other git repo. +* Installing the precompiled propellor binary. +* Installing the propellor haskell library using cabal/stack/apt. + +Much of this is already implemented, in non-Property form, in +Propellor.Bootstrap, but will need adjustments for this new context. +--[[Joey]] -- cgit v1.3-2-g0d8e From d6e6b48654a65c0c197a78e3ac91f4e5f74c71a5 Mon Sep 17 00:00:00 2001 From: "bardur.arantsson" Date: Tue, 28 Mar 2017 04:23:00 +0000 Subject: --- doc/forum/Using_propellor_for_continers_only.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/forum/Using_propellor_for_continers_only.mdwn (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only.mdwn b/doc/forum/Using_propellor_for_continers_only.mdwn new file mode 100644 index 00000000..c2b8673c --- /dev/null +++ b/doc/forum/Using_propellor_for_continers_only.mdwn @@ -0,0 +1,5 @@ +Hi, + +I was wondering: Is it possible to use propellor to generate images only without actually managing any hosts per-se? I couldn't find any documentation on that. + +Ideally, I'd also be able to use it directly from a sandbox so that I wouldn't have to even "pollute" the GHC/Cabal "global" (user home dir) database on the development machine. I see that there's support for having the config.hs stored in a different directory than ~/.propellor, but I haven't managed to get it working when I use a sandbox in e.g. ~/foo with the config.hs stored in the same directory. Perhaps that's just a bug? If it's supposed to work I can provide detailed error messages, etc. -- cgit v1.3-2-g0d8e From fa84f575880cec54453fb2b89f6db78528c6a0ef Mon Sep 17 00:00:00 2001 From: "bardur.arantsson" Date: Tue, 28 Mar 2017 04:24:38 +0000 Subject: --- doc/forum/Using_propellor_for_continers_only.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only.mdwn b/doc/forum/Using_propellor_for_continers_only.mdwn index c2b8673c..faf07956 100644 --- a/doc/forum/Using_propellor_for_continers_only.mdwn +++ b/doc/forum/Using_propellor_for_continers_only.mdwn @@ -2,4 +2,4 @@ Hi, I was wondering: Is it possible to use propellor to generate images only without actually managing any hosts per-se? I couldn't find any documentation on that. -Ideally, I'd also be able to use it directly from a sandbox so that I wouldn't have to even "pollute" the GHC/Cabal "global" (user home dir) database on the development machine. I see that there's support for having the config.hs stored in a different directory than ~/.propellor, but I haven't managed to get it working when I use a sandbox in e.g. ~/foo with the config.hs stored in the same directory. Perhaps that's just a bug? If it's supposed to work I can provide detailed error messages, etc. +Ideally, I'd also be able to use it directly from a sandbox so that I wouldn't have to even "pollute" the GHC/Cabal "global" (user home dir) database on the development machine. I see that there's support for having the config.hs stored in a different directory than ~/.propellor, but I haven't managed to get it working when I use a sandbox in e.g. ~/foo with the config.hs stored in the same directory. Perhaps that's just a bug? If it's supposed to work I can provide detailed error messages, etc. **EDIT:** I'd also like to manage the git repository myself -- is that possible? -- cgit v1.3-2-g0d8e From a8c6f64662578882e3470ba0fe013677108aa4f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Mar 2017 15:13:26 -0400 Subject: response --- ...mment_1_95e8b7103f248d93570fecb6b8999996._comment | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/forum/Using_propellor_for_continers_only/comment_1_95e8b7103f248d93570fecb6b8999996._comment (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only/comment_1_95e8b7103f248d93570fecb6b8999996._comment b/doc/forum/Using_propellor_for_continers_only/comment_1_95e8b7103f248d93570fecb6b8999996._comment new file mode 100644 index 00000000..dc6cc616 --- /dev/null +++ b/doc/forum/Using_propellor_for_continers_only/comment_1_95e8b7103f248d93570fecb6b8999996._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-03-29T19:09:37Z" + content=""" +Sounds like you may want to write a program that uses propellor as a +library. `Propellor.Engine.mainProperties` is a reasonable +entry point, just pass it a Host that has the properties you want +to run. + +For example: + + import Propellor + import Propellor.Engine + import Propellor.Property.DiskImage + + main :: IO () + main = mainProperties $ host "whatever" $ props + & imageBuilt "/some/disk.img" ... +"""]] -- cgit v1.3-2-g0d8e From 680f67970dcb25fac43e96bb732be1e53ffdffe5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Apr 2017 16:46:38 -0400 Subject: bug report --- doc/todo/initial_spin_compile_failure_recovery.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/initial_spin_compile_failure_recovery.mdwn (limited to 'doc') diff --git a/doc/todo/initial_spin_compile_failure_recovery.mdwn b/doc/todo/initial_spin_compile_failure_recovery.mdwn new file mode 100644 index 00000000..423b279c --- /dev/null +++ b/doc/todo/initial_spin_compile_failure_recovery.mdwn @@ -0,0 +1,5 @@ +When initial propellor --spin host fails to compile propellor +perhaps due to a ghc compatability bug, spinning again doesn't fix the +problem. IIRC /usr/local/propellor has a git repo set up, but no remote +set, and so the subsequent spin doesn't update it, since propellor is not +running there to receive a git push into the repo. --[[Joey]] -- cgit v1.3-2-g0d8e From 2afeb3661f04beb0a84b740b327917c16ed27a3d Mon Sep 17 00:00:00 2001 From: "db48x@80bd751a72d5a80737e2f875342cf845629c7202" Date: Tue, 4 Apr 2017 21:07:53 +0000 Subject: --- doc/forum/Git.cloned_deletes_harmless_empty_directory.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/forum/Git.cloned_deletes_harmless_empty_directory.mdwn (limited to 'doc') diff --git a/doc/forum/Git.cloned_deletes_harmless_empty_directory.mdwn b/doc/forum/Git.cloned_deletes_harmless_empty_directory.mdwn new file mode 100644 index 00000000..ce3c192c --- /dev/null +++ b/doc/forum/Git.cloned_deletes_harmless_empty_directory.mdwn @@ -0,0 +1,3 @@ +In my case I have carefully set up the directory that I'm going to clone into with the correct group ownership and setgid permission, so that the cloned files will also have the correct ownership. This change just checks to see if the directory actually has anything in it before it deletes it. + +https://github.com/ArchiveTeam/glowing-computing-machine/tree/git-in-emtpy-directory -- cgit v1.3-2-g0d8e From 1573c094362be744517d7d5e909a2148e6d79618 Mon Sep 17 00:00:00 2001 From: "db48x@80bd751a72d5a80737e2f875342cf845629c7202" Date: Tue, 4 Apr 2017 21:10:01 +0000 Subject: --- doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap.mdwn (limited to 'doc') diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap.mdwn b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap.mdwn new file mode 100644 index 00000000..61cd10cc --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap.mdwn @@ -0,0 +1,3 @@ +The mount command won't work when activating a swap partition/file, so we should call swapon instead. + +https://github.com/ArchiveTeam/glowing-computing-machine/tree/fstab-swap -- cgit v1.3-2-g0d8e From 7a2a88c12805f277e1e89e63b006a0783ea8cc0b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Apr 2017 22:31:00 -0400 Subject: comments --- ...mment_1_8ab6b313c80486f8f87a5e13e830bfa9._comment | 20 ++++++++++++++++++++ ...mment_1_7cd0521c6d071b25852f8355f4f61f94._comment | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_1_8ab6b313c80486f8f87a5e13e830bfa9._comment create mode 100644 doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_1_7cd0521c6d071b25852f8355f4f61f94._comment (limited to 'doc') diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_1_8ab6b313c80486f8f87a5e13e830bfa9._comment b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_1_8ab6b313c80486f8f87a5e13e830bfa9._comment new file mode 100644 index 00000000..4a144df5 --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_1_8ab6b313c80486f8f87a5e13e830bfa9._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-04-05T02:17:00Z" + content=""" +This idea kind of makes sense, because swap partitions in /etc/fstab +get swaponed at boot. + +But, the implementation doesn't take the types into account. The `mounted` +property takes a FilePath for the mountpoint, but for swap that +needs to be "none", which is not really a file-path. Also, the `fstabbed` +property has a separate `SwapPartition` type, so making `mount` support +swap partitions without using that type feels wrong. + +It might be simpler all round to treat swap partitions being able to +be specified in /etc/fstab as a historical accident, which it kind of +is (increasingly so, since eg systemd has other ways to accomplish +that), and instead of shoehorning this into the `mounted` property, +add a new `swaponed` property. +"""]] diff --git a/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_1_7cd0521c6d071b25852f8355f4f61f94._comment b/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_1_7cd0521c6d071b25852f8355f4f61f94._comment new file mode 100644 index 00000000..91b403b0 --- /dev/null +++ b/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_1_7cd0521c6d071b25852f8355f4f61f94._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-04-05T02:22:54Z" + content=""" +I am not entirely happy with this patch, because it seems that if +Git.cloned took care to preserve permissions in this case, it could be +argued that it should also preserve permissions when the directory already +exists but has the wrong content. Or equally well argued that it should not +preserve permissions, which might be a leftover from some past unwanted +state. + +Is that really the best way to do it? You could instead say: + + Git.cloned user repo dir Nothing + `onChange` recursiveSetGID user dir + +And then you just have to write a recursiveSetGID which would be a +generally useful property. +"""]] -- cgit v1.3-2-g0d8e From 9e6eff4e9fb0859c67d58b8beaf96fe0b472ac21 Mon Sep 17 00:00:00 2001 From: "db48x@80bd751a72d5a80737e2f875342cf845629c7202" Date: Wed, 5 Apr 2017 02:37:45 +0000 Subject: Added a comment --- .../comment_2_289f157f129511242d93beae76fd03a3._comment | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_2_289f157f129511242d93beae76fd03a3._comment (limited to 'doc') diff --git a/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_2_289f157f129511242d93beae76fd03a3._comment b/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_2_289f157f129511242d93beae76fd03a3._comment new file mode 100644 index 00000000..1a8c1447 --- /dev/null +++ b/doc/forum/Git.cloned_deletes_harmless_empty_directory/comment_2_289f157f129511242d93beae76fd03a3._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="db48x@80bd751a72d5a80737e2f875342cf845629c7202" + nickname="db48x" + avatar="http://cdn.libravatar.org/avatar/ad2688127feb555a92154b16d8eeb5d3" + subject="comment 2" + date="2017-04-05T02:37:44Z" + content=""" +Yea, I guess that's a fair point about the other cases. + +It just seems inelegant to go back over all the files and fix up their permissions, when it could just have been set right to begin with. +"""]] -- cgit v1.3-2-g0d8e From c14d4430bc70f69f41b2645f3ea25869d4f759bb Mon Sep 17 00:00:00 2001 From: "db48x@80bd751a72d5a80737e2f875342cf845629c7202" Date: Wed, 5 Apr 2017 02:48:08 +0000 Subject: Added a comment --- .../comment_2_773fc1441dd06e9dd41508bd800298eb._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_2_773fc1441dd06e9dd41508bd800298eb._comment (limited to 'doc') diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_2_773fc1441dd06e9dd41508bd800298eb._comment b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_2_773fc1441dd06e9dd41508bd800298eb._comment new file mode 100644 index 00000000..62cabc0a --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_2_773fc1441dd06e9dd41508bd800298eb._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="db48x@80bd751a72d5a80737e2f875342cf845629c7202" + nickname="db48x" + avatar="http://cdn.libravatar.org/avatar/ad2688127feb555a92154b16d8eeb5d3" + subject="comment 2" + date="2017-04-05T02:48:08Z" + content=""" +Yes, perhaps if it took an Option FilePath (am I saying this correctly in Haskellese?) it would be nicer. + +I don't mind much how it's structured; this was just the smallest obvious change, since it was failing to mount it. Perhaps breaking it up into smaller, more primitive, pieces would help. Fstab.mounted could = Fstab.fstabbed `onChange` Fstab.mounted, for instance, and then I could write Fstab.fstabbed `onChange` Swap.swapEnabled (oh, but Fstab.fstabbed already exists; I'm not using it because it replaces the whole file, which seems like an odd thing to do. Maybe call it Fstab.listed instead?). + +Also, for maximum irony I was just perusing your most recent dozen commits or so, and saw you enable Apt.serviceInstalledRunning \"swapspace\" on one of your machines. That's amazing; I had no idea it existed! I am re-evaluating all of my life choices now. +"""]] -- cgit v1.3-2-g0d8e From fcc5b96e595a20a8b93989fa59f2b73d1b6d3a1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Apr 2017 23:12:39 -0400 Subject: comment --- .../comment_3_f48a6191c56bed41eda55436f0aa3e9c._comment | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_3_f48a6191c56bed41eda55436f0aa3e9c._comment (limited to 'doc') diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_3_f48a6191c56bed41eda55436f0aa3e9c._comment b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_3_f48a6191c56bed41eda55436f0aa3e9c._comment new file mode 100644 index 00000000..95c69551 --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_3_f48a6191c56bed41eda55436f0aa3e9c._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2017-04-05T03:08:30Z" + content=""" +I like the idea of composing smaller properties to build the current +property, and add flexability. + +Renaming the existing `fstabbed` would probably be too much bother. +(Also, I think I picked that name because it kind of hints that the +existing fstab does not come out alive.) + +(The swapspace package is great if you can eat the now tiny overhead of a +swap file compared to a swap partition.) +"""]] -- cgit v1.3-2-g0d8e From 9298008c9d7d4c0dc6d4f59fd5cc48b1153bc009 Mon Sep 17 00:00:00 2001 From: "db48x@80bd751a72d5a80737e2f875342cf845629c7202" Date: Wed, 5 Apr 2017 06:39:49 +0000 Subject: Added a comment --- .../comment_4_b1769231a633ad2b978ee4c9fa90591c._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_4_b1769231a633ad2b978ee4c9fa90591c._comment (limited to 'doc') diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_4_b1769231a633ad2b978ee4c9fa90591c._comment b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_4_b1769231a633ad2b978ee4c9fa90591c._comment new file mode 100644 index 00000000..ca04f945 --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_4_b1769231a633ad2b978ee4c9fa90591c._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="db48x@80bd751a72d5a80737e2f875342cf845629c7202" + nickname="db48x" + avatar="http://cdn.libravatar.org/avatar/ad2688127feb555a92154b16d8eeb5d3" + subject="comment 4" + date="2017-04-05T06:39:49Z" + content=""" +I took a stab at implementing this. It compiles, but I've not tested it yet as I need to get some sleep; consider it a work in progress. Looks right to me though. +"""]] -- cgit v1.3-2-g0d8e From abc6a32c938c9b241428ca749b2dd2b39b9f7cc0 Mon Sep 17 00:00:00 2001 From: "bardur.arantsson" Date: Thu, 6 Apr 2017 02:14:58 +0000 Subject: Added a comment --- .../comment_2_42b45a126cfdf1dfc370b166c8042690._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Using_propellor_for_continers_only/comment_2_42b45a126cfdf1dfc370b166c8042690._comment (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only/comment_2_42b45a126cfdf1dfc370b166c8042690._comment b/doc/forum/Using_propellor_for_continers_only/comment_2_42b45a126cfdf1dfc370b166c8042690._comment new file mode 100644 index 00000000..45cd3e0c --- /dev/null +++ b/doc/forum/Using_propellor_for_continers_only/comment_2_42b45a126cfdf1dfc370b166c8042690._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="bardur.arantsson" + avatar="http://cdn.libravatar.org/avatar/a0be0039b44d33262b7ae650a0803ad5" + subject="comment 2" + date="2017-04-06T02:14:58Z" + content=""" +I'll try that this weekend, thanks! +"""]] -- cgit v1.3-2-g0d8e From 57525e0d0d1d300aa807f1c876945ee5e38a29df Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Apr 2017 20:08:14 -0400 Subject: tweaks to db45x's patch Removed mountNow as a top-level property, as I don't think it makes sense for anything except for mounted to use it. db45x's patch turns out to have introduced a bug in mounted's use of "mountNow src". That made mountNow check if the device was a mount point, which it isn't. The fix would have been to use "mountNow mnt", but my inlining of mountnow just basically reverted the part of the patch that introduced the bug. swapOn does not involve the fstab so moved to the Mount module. (Also noticed that Mount.mounted is a kind of weird property, given that it fails the next time ran. It's only used internally by some chroot properties, so I left it as-is, but added a comment. It might make sense to make Mount.mounted check like mountNow does if the thing is already mounted.) --- debian/changelog | 7 +++ ...ent_5_6dc24952c8efa31a401191a8cf2d0b39._comment | 14 ++++++ src/Propellor/Property/Fstab.hs | 52 +++++++++------------- src/Propellor/Property/Mount.hs | 14 ++++++ 4 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_5_6dc24952c8efa31a401191a8cf2d0b39._comment (limited to 'doc') diff --git a/debian/changelog b/debian/changelog index c3ae1903..dcbe0a3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +propellor (4.0.3) UNRELEASED; urgency=medium + + * Added Fstab.listed, Fstab.swap, and Mount.swapOn properties. + Thanks, Daniel Brooks. + + -- Joey Hess Thu, 06 Apr 2017 19:40:12 -0400 + propellor (4.0.2) unstable; urgency=medium * Apt.mirror can be used to set the preferred apt mirror of a host, diff --git a/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_5_6dc24952c8efa31a401191a8cf2d0b39._comment b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_5_6dc24952c8efa31a401191a8cf2d0b39._comment new file mode 100644 index 00000000..f87500b2 --- /dev/null +++ b/doc/forum/Fstab.mounted_could_call_swapon_when_activating_swap/comment_5_6dc24952c8efa31a401191a8cf2d0b39._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2017-04-06T23:51:08Z" + content=""" +Merged. Have not tested it either. + +On my Debian system, the swapon command does not support the +`--no-headings` that you used. It's `--noheadings` here. Is that a typo in +your patch? + +I've simply removed that option for now, since it probably won't +hurt if it treats the heading like another device that's swapped on. +"""]] diff --git a/src/Propellor/Property/Fstab.hs b/src/Propellor/Property/Fstab.hs index 8196377f..29b85426 100644 --- a/src/Propellor/Property/Fstab.hs +++ b/src/Propellor/Property/Fstab.hs @@ -14,16 +14,6 @@ import Data.Char import Data.List import Utility.Table --- | Ensures that contains a line mounting the specified --- `Source` on the specified `MountPoint`. -listed :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike -listed fs src mnt opts = "/etc/fstab" `File.containsLine` l - `describe` (mnt ++ " mounted by fstab") - where - l = intercalate "\t" [src, mnt, fs, formatMountOpts opts, dump, passno] - dump = "0" - passno = "2" - -- | Ensures that contains a line mounting the specified -- `Source` on the specified `MountPoint`, and that it's currently mounted. -- @@ -34,29 +24,31 @@ listed fs src mnt opts = "/etc/fstab" `File.containsLine` l -- Note that if anything else is already mounted at the `MountPoint`, it -- will be left as-is by this property. mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property Linux -mounted fs src mnt opts = (listed fs src mnt opts) `onChange` (mountNow src) +mounted fs src mnt opts = tightenTargets $ + listed fs src mnt opts + `onChange` mountnow + where + -- This use of mountPoints, which is linux-only, is why this + -- property currently only supports linux. + mountnow = check (notElem mnt <$> mountPoints) $ + cmdProperty "mount" [mnt] + +-- | Ensures that contains a line mounting the specified +-- `Source` on the specified `MountPoint`. Does not ensure that it's +-- currently `mounted`. +listed :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike +listed fs src mnt opts = "/etc/fstab" `File.containsLine` l + `describe` (mnt ++ " mounted by fstab") + where + l = intercalate "\t" [src, mnt, fs, formatMountOpts opts, dump, passno] + dump = "0" + passno = "2" -- | Ensures that contains a line enabling the specified --- `Source` to be used as swap space, and that it's enabled +-- `Source` to be used as swap space, and that it's enabled. swap :: Source -> Property Linux -swap src = (listed "swap" src "none" mempty) `onChange` (swapOn src) - --- This use of mountPoints, which is linux-only, is why this --- property currently only supports linux. -mountNow :: Source -> RevertableProperty Linux Linux -mountNow mnt = tightenTargets domount tightenTargets doumount - where domount = check (notElem mnt <$> mountPoints) $ - cmdProperty "mount" [mnt] - doumount = check (elem mnt <$> mountPoints) $ - cmdProperty "umount" [mnt] - -swapOn :: Source -> RevertableProperty Linux Linux -swapOn mnt = tightenTargets doswapon tightenTargets doswapoff - where swaps = lines <$> readProcess "swapon" ["--no-headings", "--show=NAME"] - doswapon = check (notElem mnt <$> swaps) $ - cmdProperty "swapon" [mnt] - doswapoff = check (elem mnt <$> swaps) $ - cmdProperty "swapoff" [mnt] +swap src = listed "swap" src "none" mempty + `onChange` swapOn src newtype SwapPartition = SwapPartition FilePath diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index 026509a9..5dcc5fe1 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -40,6 +40,9 @@ formatMountOpts (MountOpts []) = "defaults" formatMountOpts (MountOpts l) = intercalate "," l -- | Mounts a device, without listing it in . +-- +-- Note that this property will fail if the device is already mounted +-- at the MountPoint. mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike mounted fs src mnt opts = property (mnt ++ " mounted") $ toResult <$> liftIO (mount fs src mnt opts) @@ -52,6 +55,17 @@ bindMount src dest = tightenTargets $ `assume` MadeChange `describe` ("bind mounted " ++ src ++ " to " ++ dest) +-- | Enables swapping to a device, which must be formatted already as a swap +-- partition. +swapOn :: Source -> RevertableProperty Linux Linux +swapOn mnt = tightenTargets doswapon tightenTargets doswapoff + where + swaps = lines <$> readProcess "swapon" ["--show=NAME"] + doswapon = check (notElem mnt <$> swaps) $ + cmdProperty "swapon" [mnt] + doswapoff = check (elem mnt <$> swaps) $ + cmdProperty "swapoff" [mnt] + mount :: FsType -> Source -> MountPoint -> MountOpts -> IO Bool mount fs src mnt opts = boolSystem "mount" $ [ Param "-t", Param fs -- cgit v1.3-2-g0d8e From 4ba09ab6844cc3fc3e94856da22190555b697193 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Apr 2017 15:00:33 -0400 Subject: added Propellor.Property.Bootstrap (untested) This commit was sponsored by Jake Vosloo on Patreon. --- ...ent_1_b05e9a44e5c7130d9cc928223cd82d78._comment | 16 ++++ joeyconfig.hs | 4 +- propellor.cabal | 1 + src/Propellor/Property/Bootstrap.hs | 95 ++++++++++++++++++++++ src/Propellor/Property/Cmd.hs | 1 + 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 doc/todo/property_to_install_propellor/comment_1_b05e9a44e5c7130d9cc928223cd82d78._comment create mode 100644 src/Propellor/Property/Bootstrap.hs (limited to 'doc') diff --git a/doc/todo/property_to_install_propellor/comment_1_b05e9a44e5c7130d9cc928223cd82d78._comment b/doc/todo/property_to_install_propellor/comment_1_b05e9a44e5c7130d9cc928223cd82d78._comment new file mode 100644 index 00000000..5a826fea --- /dev/null +++ b/doc/todo/property_to_install_propellor/comment_1_b05e9a44e5c7130d9cc928223cd82d78._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-04-09T17:42:10Z" + content=""" +Making this work when propellor is setting up a chroot is difficult, +because the localdir is bind mounted into the chroot. + +Hmm, `unshare` could be helpful. Run shell commands to clone the localdir +inside `unshare -m`, prefixed with a `umount localdir`. This way, the bind +mount is avoided, and it writes "under" it. Limits the commands that can be +run to set up the localdir to shell commands, but bootstrap already +operates on terms of shell commands so that seems ok. + +`unshare` is linux-specific; comes in util-linux on modern linuxes. +"""]] diff --git a/joeyconfig.hs b/joeyconfig.hs index e73897b4..036c2c92 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -38,6 +38,7 @@ import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuil import qualified Propellor.Property.SiteSpecific.Branchable as Branchable import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites import Propellor.Property.DiskImage +import Propellor.Property.Bootstrap main :: IO () -- _ ______`| ,-.__ main = defaultMain hosts -- / \___-=O`/|O`/__| (____.' @@ -93,7 +94,7 @@ darkstar = host "darkstar.kitenet.net" $ props [ (SshRsa, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1YoyHxZwG5Eg0yiMTJLSWJ/+dMM6zZkZiR4JJ0iUfP+tT2bm/lxYompbSqBeiCq+PYcSC67mALxp1vfmdOV//LWlbXfotpxtyxbdTcQbHhdz4num9rJQz1tjsOsxTEheX5jKirFNC5OiKhqwIuNydKWDS9qHGqsKcZQ8p+n1g9Lr3nJVGY7eRRXzw/HopTpwmGmAmb9IXY6DC2k91KReRZAlOrk0287LaK3eCe1z0bu7LYzqqS+w99iXZ/Qs0m9OqAPnHZjWQQ0fN4xn5JQpZSJ7sqO38TBAimM+IHPmy2FTNVVn9zGM+vN1O2xr3l796QmaUG1+XLL0shfR/OZbb joey@darkstar") ] - ! imageBuilt "/tmp/img" c MSDOS (grubBooted PC) + & imageBuilt "/tmp/img" c MSDOS (grubBooted PC) [ partition EXT2 `mountedAt` "/boot" `setFlag` BootFlag , partition EXT4 `mountedAt` "/" @@ -106,6 +107,7 @@ darkstar = host "darkstar.kitenet.net" $ props & Hostname.setTo "demo" & Apt.installed ["linux-image-amd64"] & User "root" `User.hasInsecurePassword` "root" + & bootstrappedFrom GitRepoOutsideChroot gnu :: Host gnu = host "gnu.kitenet.net" $ props diff --git a/propellor.cabal b/propellor.cabal index a04089b5..f4a1f23a 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -87,6 +87,7 @@ Library Propellor.Property.Apt Propellor.Property.Apt.PPA Propellor.Property.Attic + Propellor.Property.Bootstrap Propellor.Property.Borg Propellor.Property.Ccache Propellor.Property.Cmd diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs new file mode 100644 index 00000000..6158d967 --- /dev/null +++ b/src/Propellor/Property/Bootstrap.hs @@ -0,0 +1,95 @@ +module Propellor.Property.Bootstrap (RepoSource(..), bootstrappedFrom, clonedFrom) where + +import Propellor.Base +import Propellor.Bootstrap +import Propellor.Property.Chroot + +import Data.List + +-- | Where a propellor repository should be bootstrapped from. +data RepoSource + = GitRepoUrl String + | GitRepoOutsideChroot + +-- | Bootstraps a propellor installation into +-- /usr/local/propellor/ +-- +-- Normally, propellor is already bootstrapped when it runs, so this +-- property is not useful. However, this can be useful inside a +-- chroot used to build a disk image, to make the disk image +-- have propellor installed. +-- +-- The git repository is cloned (or pulled to update if it already exists). +-- +-- All build dependencies are installed, using distribution packages +-- or falling back to using cabal. +bootstrappedFrom :: RepoSource -> Property Linux +bootstrappedFrom reposource = go `requires` clonedFrom reposource + where + go :: Property Linux + go = property "Propellor bootstrapped" $ do + system <- getOS + assumeChange $ exposeTrueLocaldir $ buildShellCommand + [ "cd " ++ localdir + , bootstrapPropellorCommand system + ] + +-- | Clones the propellor repeository into /usr/local/propellor/ +-- +-- GitRepoOutsideChroot can be used when this is used in a chroot. +-- In that case, it clones the /usr/local/propellor/ from outside the +-- chroot into the same path inside the chroot. +-- +-- If the propellor repo has already been cloned, pulls to get it +-- up-to-date. +clonedFrom :: RepoSource -> Property Linux +clonedFrom reposource = property ("Propellor repo cloned from " ++ originloc) $ do + ifM needclone + ( do + let tmpclone = localdir ++ ".tmpclone" + system <- getOS + assumeChange $ exposeTrueLocaldir $ buildShellCommand + [ installGitCommand system + , "rm -rf " ++ tmpclone + , "git clone " ++ shellEscape originloc ++ " " ++ tmpclone + , "mkdir -p " ++ localdir + -- This is done rather than deleting + -- the old localdir, because if it is bound + -- mounted from outside the chroot, deleting + -- it after unmounting in unshare will remove + -- the bind mount outside the unshare. + , "(cd " ++ tmpclone ++ " && tar c) | (cd " ++ localdir ++ " && tar x)" + , "rm -rf " ++ tmpclone + ] + , assumeChange $ exposeTrueLocaldir $ buildShellCommand + [ "cd " ++ localdir + , "git pull" + ] + ) + where + needclone = (inChroot <&&> truelocaldirisempty) + <||> (liftIO (not <$> doesDirectoryExist localdir)) + truelocaldirisempty = exposeTrueLocaldir $ + "test ! -d " ++ localdir ++ "/.git" + originloc = case reposource of + GitRepoUrl s -> s + GitRepoOutsideChroot -> localdir + +-- | Runs the shell command with the true localdir exposed, +-- not the one bind-mounted into a chroot. +exposeTrueLocaldir :: String -> Propellor Bool +exposeTrueLocaldir s = do + s' <- ifM inChroot + ( return $ "unshare -m sh -c " ++ shellEscape + ("umount " ++ localdir ++ " && ( " ++ s ++ ")") + , return s + ) + liftIO $ boolSystem "sh" [ Param "-c", Param s'] + +assumeChange :: Propellor Bool -> Propellor Result +assumeChange a = do + ok <- a + return (cmdResult ok <> MadeChange) + +buildShellCommand :: [String] -> String +buildShellCommand = intercalate "&&" . map (\c -> "(" ++ c ++ ")") diff --git a/src/Propellor/Property/Cmd.hs b/src/Propellor/Property/Cmd.hs index 6b84acb5..f2de1a27 100644 --- a/src/Propellor/Property/Cmd.hs +++ b/src/Propellor/Property/Cmd.hs @@ -33,6 +33,7 @@ module Propellor.Property.Cmd ( Script, scriptProperty, userScriptProperty, + cmdResult, -- * Lower-level interface for running commands CommandParam(..), boolSystem, -- cgit v1.3-2-g0d8e From 9dbd25a91c88a99832db5a2b31f0e87f0bff47e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Apr 2017 16:49:38 -0400 Subject: well, that didnt work :( --- .../comment_2_9fea601af57777e1cb49952483f4da63._comment | 7 +++++++ src/Propellor/Property/Bootstrap.hs | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 doc/todo/property_to_install_propellor/comment_2_9fea601af57777e1cb49952483f4da63._comment (limited to 'doc') diff --git a/doc/todo/property_to_install_propellor/comment_2_9fea601af57777e1cb49952483f4da63._comment b/doc/todo/property_to_install_propellor/comment_2_9fea601af57777e1cb49952483f4da63._comment new file mode 100644 index 00000000..f862f79b --- /dev/null +++ b/doc/todo/property_to_install_propellor/comment_2_9fea601af57777e1cb49952483f4da63._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2017-04-09T20:49:04Z" + content=""" +Well, seems that `unshare` does not work in a chroot. Hmm. +"""]] diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index 6158d967..4a60276e 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -77,6 +77,9 @@ clonedFrom reposource = property ("Propellor repo cloned from " ++ originloc) $ -- | Runs the shell command with the true localdir exposed, -- not the one bind-mounted into a chroot. +-- +-- FIXME: unshare -m does not work in a chroot! +-- "unshare: cannot change root filesystem propagation: Invalid argument" exposeTrueLocaldir :: String -> Propellor Bool exposeTrueLocaldir s = do s' <- ifM inChroot -- cgit v1.3-2-g0d8e From 8d02f00412cc57a909a0cf0567c106108e19ab4c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Apr 2017 17:52:19 -0400 Subject: done --- debian/changelog | 2 ++ doc/todo/property_to_install_propellor.mdwn | 2 ++ 2 files changed, 4 insertions(+) (limited to 'doc') diff --git a/debian/changelog b/debian/changelog index dcbe0a3e..70aa139d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ propellor (4.0.3) UNRELEASED; urgency=medium * Added Fstab.listed, Fstab.swap, and Mount.swapOn properties. Thanks, Daniel Brooks. + * Added Propellor.Property.Bootstrap, which can be used to make + disk images contain their own installation of propellor. -- Joey Hess Thu, 06 Apr 2017 19:40:12 -0400 diff --git a/doc/todo/property_to_install_propellor.mdwn b/doc/todo/property_to_install_propellor.mdwn index 25db8193..184977f5 100644 --- a/doc/todo/property_to_install_propellor.mdwn +++ b/doc/todo/property_to_install_propellor.mdwn @@ -12,3 +12,5 @@ Should support: Much of this is already implemented, in non-Property form, in Propellor.Bootstrap, but will need adjustments for this new context. --[[Joey]] + +> [[done]] -- cgit v1.3-2-g0d8e From 3df52cf2fb5cdb92b407195f55467e3b5ef26785 Mon Sep 17 00:00:00 2001 From: joelmccracken Date: Thu, 13 Apr 2017 20:50:08 +0000 Subject: --- doc/forum/Work_on_OS_X.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/forum/Work_on_OS_X.mdwn (limited to 'doc') diff --git a/doc/forum/Work_on_OS_X.mdwn b/doc/forum/Work_on_OS_X.mdwn new file mode 100644 index 00000000..e3c5fd64 --- /dev/null +++ b/doc/forum/Work_on_OS_X.mdwn @@ -0,0 +1,5 @@ +I'm interested in using Propellor on OS X. I understand that it is not supported though. + +Is there anyone doing this? If it was developed, would support for OS X be merged upstream? + +Thanks! -- cgit v1.3-2-g0d8e From 7dbde4c109b09eb8eee198e71de1500846fc7a88 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Apr 2017 17:42:52 -0400 Subject: response --- ...mment_1_6d7d5b89f1de9604718f7973e4b3eeb1._comment | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/forum/Work_on_OS_X/comment_1_6d7d5b89f1de9604718f7973e4b3eeb1._comment (limited to 'doc') diff --git a/doc/forum/Work_on_OS_X/comment_1_6d7d5b89f1de9604718f7973e4b3eeb1._comment b/doc/forum/Work_on_OS_X/comment_1_6d7d5b89f1de9604718f7973e4b3eeb1._comment new file mode 100644 index 00000000..4eac2063 --- /dev/null +++ b/doc/forum/Work_on_OS_X/comment_1_6d7d5b89f1de9604718f7973e4b3eeb1._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-04-13T21:36:20Z" + content=""" +I got a patch some years back to make propellor compile on OSX. +I merged it. You might want to get in touch with its author, as +he may be doing something with propellor on OSX. + + +Anyway, I'd probably merge OSX patches, if they were not super +intrusive. And I don't see why it would be, as propellor already supports +FreeBSD. + +Since `Property` is parameterized by the operating systems it +supports, it should be easy to start by only porting the core parts +of propellor, and then port over individual Properties one by one as +needed. See the commits for the recent FreeBSD port for a nice walkthough +of the changes you'll want to make. +"""]] -- cgit v1.3-2-g0d8e From b7622d7e2391623a99a899c31b8edf960ade6dfc Mon Sep 17 00:00:00 2001 From: joelmccracken Date: Mon, 17 Apr 2017 17:47:30 +0000 Subject: Added a comment --- .../comment_2_00b20c240fc13bed6dc54e5b985b41e2._comment | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/forum/Work_on_OS_X/comment_2_00b20c240fc13bed6dc54e5b985b41e2._comment (limited to 'doc') diff --git a/doc/forum/Work_on_OS_X/comment_2_00b20c240fc13bed6dc54e5b985b41e2._comment b/doc/forum/Work_on_OS_X/comment_2_00b20c240fc13bed6dc54e5b985b41e2._comment new file mode 100644 index 00000000..aa33c85b --- /dev/null +++ b/doc/forum/Work_on_OS_X/comment_2_00b20c240fc13bed6dc54e5b985b41e2._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joelmccracken" + avatar="http://cdn.libravatar.org/avatar/45175015b9eb3dd3f6c740b3fe920fed" + subject="comment 2" + date="2017-04-17T17:47:30Z" + content=""" +Sounds good. I contacted the person you linked to, have not heard back yet. + + + +The first issue I ran into is that propellor wants to connect to \"root@\", and it doesn't look like this is configurable. +Would you accept a patch to make this configurable? + +Additionally, is this the best place to ask questions about what you would/would not accept? + +Thank you!!! +"""]] -- cgit v1.3-2-g0d8e From 162b0d77dd607316b79dad2aa7d0e2986927746b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Apr 2017 20:12:12 -0400 Subject: response --- .../comment_3_294f4783522a8e4887793aac921ee546._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/forum/Work_on_OS_X/comment_3_294f4783522a8e4887793aac921ee546._comment (limited to 'doc') diff --git a/doc/forum/Work_on_OS_X/comment_3_294f4783522a8e4887793aac921ee546._comment b/doc/forum/Work_on_OS_X/comment_3_294f4783522a8e4887793aac921ee546._comment new file mode 100644 index 00000000..ed654d3f --- /dev/null +++ b/doc/forum/Work_on_OS_X/comment_3_294f4783522a8e4887793aac921ee546._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2017-04-18T00:08:13Z" + content=""" +Yes, this is the place. Or you can email me directly, but I prefer to keep +discussions public. + +`propellor --spin` needs a way to run commands as root on the remote host. +If ssh as root on OSX is not allowed, it would need a way to get to a user +who can get root, and it would be very annoying if a password needed to be +entered since each `propellor --spin` actually makes several ssh connections to +the remote host. Anything that works within these constraints would be ok. +"""]] -- cgit v1.3-2-g0d8e From 743d0a7b0fe0fae3dc3fc65307c33a2b2da82521 Mon Sep 17 00:00:00 2001 From: joelmccracken Date: Thu, 20 Apr 2017 02:23:06 +0000 Subject: Added a comment --- .../comment_4_74b579d4d590432b6bd236ccb929cc11._comment | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/forum/Work_on_OS_X/comment_4_74b579d4d590432b6bd236ccb929cc11._comment (limited to 'doc') diff --git a/doc/forum/Work_on_OS_X/comment_4_74b579d4d590432b6bd236ccb929cc11._comment b/doc/forum/Work_on_OS_X/comment_4_74b579d4d590432b6bd236ccb929cc11._comment new file mode 100644 index 00000000..d386c1b5 --- /dev/null +++ b/doc/forum/Work_on_OS_X/comment_4_74b579d4d590432b6bd236ccb929cc11._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joelmccracken" + avatar="http://cdn.libravatar.org/avatar/45175015b9eb3dd3f6c740b3fe920fed" + subject="comment 4" + date="2017-04-20T02:23:06Z" + content=""" +So, it turns out that yes, root is a thing on os x... but it is complicated. I'm going to put what I learned here because I think it will be useful, at least for telling folks how to use propellor on os x. + +1. Enable the root account. Steps are here: https://support.apple.com/en-us/HT204012 +2. password-authentication as root is disabled -- if you try to `ssh root@localhost`, it wont work. you need a key pair. +3. use su/sudo to install a public key (probably at `.ssh/id_rsa.pub`) to roots authorized_keys. adapted from: https://discussions.apple.com/thread/4078360?start=0&tstart=0 +4. copy the the pub file to authorized keys: `sudo cp /Users/joel/.ssh/id_rsa.pub /var/root/.ssh/authorized_keys` +5. you should now be able to `ssh root@localhost` without a password. + +I'm not super sure that this is even the best way forward, but lets get this working first, then we'll see. +"""]] -- cgit v1.3-2-g0d8e From da9e56615f09583d94edf78d72455ec114be866d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Apr 2017 00:58:21 -0400 Subject: add news item for propellor 4.0.3 --- doc/news/version_4.0.2.mdwn | 12 ------------ doc/news/version_4.0.3.mdwn | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 doc/news/version_4.0.2.mdwn create mode 100644 doc/news/version_4.0.3.mdwn (limited to 'doc') diff --git a/doc/news/version_4.0.2.mdwn b/doc/news/version_4.0.2.mdwn deleted file mode 100644 index b955c579..00000000 --- a/doc/news/version_4.0.2.mdwn +++ /dev/null @@ -1,12 +0,0 @@ -propellor 4.0.2 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Apt.mirror can be used to set the preferred apt mirror of a host, - overriding the default CDN. This info is used by - Apt.stdSourcesList and Sbuild.builtFor. - Thanks, Sean Whitton. - * Property.Partition: Update kpartx output parser, as its output format - changed around version 0.6. Both output formats are supported now. - * Fix bug when using setContainerProps with a chroot that prevented - properties added to a chroot that way from being seen when propellor - was running inside the chroot. This affected disk image creation, and - possibly other things that use chroots."""]] \ No newline at end of file diff --git a/doc/news/version_4.0.3.mdwn b/doc/news/version_4.0.3.mdwn new file mode 100644 index 00000000..eb467287 --- /dev/null +++ b/doc/news/version_4.0.3.mdwn @@ -0,0 +1,6 @@ +propellor 4.0.3 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added Fstab.listed, Fstab.swap, and Mount.swapOn properties. + Thanks, Daniel Brooks. + * Added Propellor.Property.Bootstrap, which can be used to make + disk images contain their own installation of propellor."""]] \ No newline at end of file -- cgit v1.3-2-g0d8e From 89d216c838f989bcc8783e4b3a650a2157286389 Mon Sep 17 00:00:00 2001 From: "bardur.arantsson" Date: Fri, 12 May 2017 06:50:49 +0000 Subject: Added a comment --- ...ent_3_cd4b9b9e160469e9f0b105f6c40a4ef8._comment | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 doc/forum/Using_propellor_for_continers_only/comment_3_cd4b9b9e160469e9f0b105f6c40a4ef8._comment (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only/comment_3_cd4b9b9e160469e9f0b105f6c40a4ef8._comment b/doc/forum/Using_propellor_for_continers_only/comment_3_cd4b9b9e160469e9f0b105f6c40a4ef8._comment new file mode 100644 index 00000000..fceeedcf --- /dev/null +++ b/doc/forum/Using_propellor_for_continers_only/comment_3_cd4b9b9e160469e9f0b105f6c40a4ef8._comment @@ -0,0 +1,54 @@ +[[!comment format=mdwn + username="bardur.arantsson" + avatar="http://cdn.libravatar.org/avatar/a0be0039b44d33262b7ae650a0803ad5" + subject="comment 3" + date="2017-05-12T06:50:49Z" + content=""" +Ok, so I've tried to use this to build a Chroot (a reasonable starting point for building containers), using the following program: + + module Main + ( main + ) where + + import Propellor + import Propellor.Engine + import Propellor.Property.DiskImage + import qualified Propellor.Property.Apt as Apt + import qualified Propellor.Property.User as User + import Propellor.Property.Chroot + + main :: IO () + main = mainProperties $ host \"whatever\" $ props + & provisioned (mychroot \"out\") + where + mychroot d = debootstrapped mempty d $ props + & osDebian Unstable X86_64 + & Apt.installed [\"linux-image-amd64\"] + & User.hasPassword (User \"root\") + & User.accountFor (User \"demo\") + & User.hasPassword (User \"demo\") + +It seems that \"debootstrap\" finishes: + + I: Configuring apt-transport-https... + I: Configuring tasksel... + I: Configuring tasksel-data... + I: Configuring libc-bin... + I: Configuring systemd... + I: Configuring ca-certificates... + I: Base system installed successfully. + +But fails immediately afterwards: + + ldd: /usr/local/propellor/propellor: No such file or directory + ** warning: user error (ldd [\"/usr/local/propellor/propellor\"] exited 1) + whatever chroot out exists ... failed + whatever overall ... failed + +(I should probably have used a different hostname than \"whatever\", but... whatever :).) + +So it seems that the chroot support still expects propellor to be installed on the host system? + +I should mention that I've done an extremely small patch to Propellor locally, just to the ChrootBootstrapper instance for ArchLinux to allow it to call debootstrap on Arch Linux -- it seems to exist as a package these days, not sure if it did when that Propellor code was written. Anyway... + +"""]] -- cgit v1.3-2-g0d8e From 51b74d0397d5f6498f167c7820fb4966be2be7c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 13 May 2017 13:53:18 -0400 Subject: response --- ...ment_4_9dc985b26c29b9ce21e6c75ec03f6262._comment | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/forum/Using_propellor_for_continers_only/comment_4_9dc985b26c29b9ce21e6c75ec03f6262._comment (limited to 'doc') diff --git a/doc/forum/Using_propellor_for_continers_only/comment_4_9dc985b26c29b9ce21e6c75ec03f6262._comment b/doc/forum/Using_propellor_for_continers_only/comment_4_9dc985b26c29b9ce21e6c75ec03f6262._comment new file mode 100644 index 00000000..72d7ca83 --- /dev/null +++ b/doc/forum/Using_propellor_for_continers_only/comment_4_9dc985b26c29b9ce21e6c75ec03f6262._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2017-05-13T17:42:41Z" + content=""" +The way propellor handles running in a chroot or container is it exports +its binary and support files into the container. This way the +haskell code can run in a container, rather than being limited to +only running shell commands in the container, and without needing ghc in +the container. + +It does use the hardcoded `localdir` for that. +It would certianly be possible to make it use propellor in a different +location, perhaps using `getExecutablePath`. + +Since the git-annex outside the container passes command-line options to +the one running inside the container to tell it what to do, using +`mainProperties` would also not work since that does not look at +command-line options. It would need to use `defaultMain` or +`processCmdLine` and dispatch itself, or something.. +"""]] -- cgit v1.3-2-g0d8e From 3d31ec60f3049a34242d4a9ae2f1956e2feb67b1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 May 2017 16:51:57 -0400 Subject: bug report --- doc/todo/spin_failure_HEAD.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/todo/spin_failure_HEAD.mdwn (limited to 'doc') diff --git a/doc/todo/spin_failure_HEAD.mdwn b/doc/todo/spin_failure_HEAD.mdwn new file mode 100644 index 00000000..c131591b --- /dev/null +++ b/doc/todo/spin_failure_HEAD.mdwn @@ -0,0 +1,10 @@ +Seen recently on 2 hosts: + + Sending privdata (73139 bytes) to kite.kitenet.net ... done + fatal: Couldn't find remote ref HEAD + propellor: : hPutStr: illegal operation (handle is closed) + fatal: The remote end hung up unexpectedly + Sending git update to kite.kitenet.net ... failed + +Despite the error, HEAD seems to be updated to the commit that is being spun, +but the rest of the propellor runs doesn't happen. --[[Joey]] -- cgit v1.3-2-g0d8e