I... kinda like that suggestion. I would keep current behaviour intact, so collection would work 'as expected though weirdly' and not break current manifests. People who are up to date on this can explicitly select an environment to collect.
I also think that this approach works better for community modules. What if your module ships with it's own native type and you want to collect on those? If you need to explicitly pass an environment for collection to even work, what do you pass, 'production' and hope that everyone works from that environment? -- Daniele Sluijters On Tuesday, 1 April 2014 11:11:38 UTC+2, Erik Dalén wrote: > > > > > On 1 April 2014 03:43, Ken Barber <k...@puppetlabs.com <javascript:>>wrote: > >> >> Upon reflection, I think it would be wise to control which resources >> are >> >> collected strictly via search expressions. I disfavor a configuration >> >> setting affecting that, because if there were one then it would be >> likely >> >> that different modules would be developed with different assumptions >> about >> >> the configured behavior. Or to put it a different way, people should >> not >> >> need to refer to Puppet's configuration to determine what any given >> snippet >> >> of DSL code means. >> > >> > I guess the problem such a solution leaves is, that people who really >> > do want global collection have to litter their code with explicit >> > environment == '*' clauses. How many people will get affected by this >> > would be interesting, seems at least 2 people on the response so far. >> > Any ideas for that? >> >> That said, I shouldn't speak for others. For those who do currently >> use global resource collection, how would such a solution affect you? >> And any other thoughts you can think of ... >> >> > 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. > > -- > Erik Dalén > -- 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/dd539a88-f926-40ab-86b9-d794cd9a3bab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.