On 1 April 2014 17:52, Ken Barber <k...@puppetlabs.com> wrote: > >> >> This seems a bit backwards to me, for all other parts of the query > you > >> >> just leave it out if you don't want to match on it. There's no need > for > >> >> a > >> >> explicit tags=='*' if you want to match on all tags for example. So I > >> >> don't > >> >> see why environment matching would work the opposite way. > >> >> > >> >> So I'm proposing instead that you add environment==$::environment to > >> >> your > >> >> query if you want to collect only from your current environment. > >> > >> How would you do this with 3rd party modules though? Modify them? > > > > > > Well, they can accept a collect_environment parameter that could default > to > > '*' or so and use that in the query. > > Isn't that the opposite of what you've been asking for as the default, > do you mean "environment = $::environment" here or have you changed > your mind about the default? > > I think the default when you leave out a parameter from a query should be to not match on that parameter, like it is today. And that environment shouldn't be different than any other parameter you can match on in this regard.
If a third party module wants to match on a environment and wants the user to be able to specify it, it can have a collect_environment parameter and add something like environment==$collect_environment to its collection query. If the default of the collect_environment parameter is '*' or $::environment is really up to the module, but perhaps there can be a best practise around that. -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAAAzDLeKeRq4BMM0JUGtF4UERQsPEwBTgZRBFFYvzBBiWxpSeQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.