Bostjan Skufca
2011-Jan-19 02:38 UTC
[Puppet Users] Puppetmaster module path specification with wildcards
Hi! Would anyone else fancy a wildcard path expansion in module path specification? Example: modulepath = /etc/puppet/modules/* -------[ above should expand to this equivalent ]------------------------------ [ provided that repo1 and repo2 dirs exist in /etc/puppet/modules ] modulepath = /etc/puppet/modules/repo1:/etc/puppet/modules/repo2 If anyone wonders what could possibly be the usecase for this, here is the answer. I manage various puppet module groups in separate git repositories and then include those repositories as submodules in main puppet config repo. And every time a new module repository is added I have to reconfigure puppetmaster by adding new path to module search path, followed by restart. With the feature described above this last step would become redundant and unnecessary. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2011-Jan-19 04:09 UTC
Re: [Puppet Users] Puppetmaster module path specification with wildcards
On Tue, Jan 18, 2011 at 18:38, Bostjan Skufca <bostjan.skufca.work@gmail.com> wrote:> Would anyone else fancy a wildcard path expansion in module path > specification?It sounds potentially useful to me, and a reasonable extension to the current behaviour; I would usually expect this to apply to all the various paths, not just one. Behaviour, I think, should be specified it terms of the Ruby Dir.glob method, so that it is clear to everyone what can and can''t be done. Anyway, sounds like a good thing to file at https://projects.puppetlabs.com/projects/puppet?jump=welcome as a new feature request, and encourage people to watch / vote for it there so we can work out how popular it is. (...or, y''know, write the patch. We are really happy to accept that sort of thing.) Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@rimspace.net> ✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Bostjan Skufca
2011-Jan-20 01:33 UTC
[Puppet Users] Re: Puppetmaster module path specification with wildcards
> (...or, y''know, write the patch. We are really happy to accept that > sort of thing.)Aaah, I always forget that these sorts of things are easy with scripted languages:) Anyway, ticked has been opened as #5936 and feature has been implemented in here: https://github.com/bostjan/puppet/tree/feature/master/5936 Can you see it through to final inclusion? For now I am using it as a patch of my own. b. On 19 jan., 05:09, Daniel Pittman <dan...@puppetlabs.com> wrote:> On Tue, Jan 18, 2011 at 18:38, Bostjan Skufca > > <bostjan.skufca.w...@gmail.com> wrote: > > Would anyone else fancy a wildcard path expansion in module path > > specification? > > It sounds potentially useful to me, and a reasonable extension to the > current behaviour; I would usually expect this to apply to all the > various paths, not just one. Behaviour, I think, should be specified > it terms of the Ruby Dir.glob method, so that it is clear to everyone > what can and can''t be done. > > Anyway, sounds like a good thing to file athttps://projects.puppetlabs.com/projects/puppet?jump=welcomeas a new > feature request, and encourage people to watch / vote for it there so > we can work out how popular it is. > > (...or, y''know, write the patch. We are really happy to accept that > sort of thing.) > > Regards, > Daniel > -- > ⎋ Puppet Labs Developer –http://puppetlabs.com > ✉ Daniel Pittman <dan...@rimspace.net> > ✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285 > ♲ Made with 100 percent post-consumer electrons-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2011-Jan-20 03:54 UTC
Re: [Puppet Users] Re: Puppetmaster module path specification with wildcards
On Wed, Jan 19, 2011 at 17:33, Bostjan Skufca <bostjan.skufca.work@gmail.com> wrote:>> (...or, y''know, write the patch. We are really happy to accept that >> sort of thing.) > > Aaah, I always forget that these sorts of things are easy with > scripted languages:) > > Anyway, ticked has been opened as #5936 and feature has been > implemented in here: > https://github.com/bostjan/puppet/tree/feature/master/5936 > > Can you see it through to final inclusion? For now I am using it as a > patch of my own.I think it has one shortfall: if it matches a file (or any non-directory) in the glob that will be added to the path also; the results of globbing should be filtered for "is a directory". If you don''t want to update for that, though, I can probably do that in the next couple of days or so – and thank you so much for the rapid contribution. Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@rimspace.net> ✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Derek J. Balling
2011-Jan-20 04:01 UTC
Re: [Puppet Users] Puppetmaster module path specification with wildcards
On Jan 18, 2011, at 9:38 PM, Bostjan Skufca wrote:> Would anyone else fancy a wildcard path expansion in module path > specification? > > Example: > > modulepath = /etc/puppet/modules/* > > -------[ above should expand to this > equivalent ]------------------------------ > [ provided that repo1 and repo2 dirs exist in /etc/puppet/modules ] > > modulepath = /etc/puppet/modules/repo1:/etc/puppet/modules/repo2There are a couple potential caveats to that, the most serious being sort methodology for the wildcard expansion. It would have to be deterministic in terms of "always being sorted the same way" (because a straight wildcard expansion will present the various directory items in essentially random order). If you care about in what order things are in the path, then it would be a bad idea to use, but if the sort-methodology is well documented so nobody is surprised, then it should be fine. (IMHO) D -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2011-Jan-20 04:05 UTC
Re: [Puppet Users] Puppetmaster module path specification with wildcards
On Wed, Jan 19, 2011 at 20:01, Derek J. Balling <dredd@megacity.org> wrote:> On Jan 18, 2011, at 9:38 PM, Bostjan Skufca wrote: >> Would anyone else fancy a wildcard path expansion in module path >> specification?[...]> There are a couple potential caveats to that, the most serious being sort methodology for the wildcard expansion. It would have to be deterministic in terms of "always being sorted the same way" (because a straight wildcard expansion will present the various directory items in essentially random order). > > If you care about in what order things are in the path, then it would be a bad idea to use, but if the sort-methodology is well documented so nobody is surprised, then it should be fine. (IMHO)I completely agree: Bostjan posted the patch to the dev list for review, and I followed up with that exact suggestion there; the version that merges will have documented and reliable semantics. (I like alphanumeric sort as well, but maybe someone else has a better suggestion. :) Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@rimspace.net> ✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.