On Tue, Apr 01, 2014 at 05:09:23PM +0100, Ken Barber <k...@puppetlabs.com>
wrote:
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.
Are there any others that would say this is their preferred default, if yes why?
So, for science, Ken and I just looked at how the old,
ActiveRecord-based storeconfigs worked with respect to
environments. We found a few things of note:
* it collects across all environments, with no way to override
* there is an "environment" field in the db schema, but it's only
attached to "host" objects
* even so, it doesn't appear that this field actually captures the
puppet client's environment anyways
For the curious, here's the code that would translate a collection
query into an activerecord query:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/indirector/resource/active_record.rb#L34
Notice that the code only supports comparisons against title, tags,
and parameter names/values. This was surprising to me, but the code's
the code. :)
As we've been collecting from all environments all along, my
inclination is to continue to work that way so as to preserve
compatibility and generally not surprise people.
I quite like the idea of allowing people to restrict collection based
on environment. That requires a slight tweak to the puppetdb terminus
code, but I don't think it'll be too bad. Erik is correct, though,
that we can't really use "environment" as the search term there
because there are some resources that use "environment" as a parameter
name (like "exec"). :/
--
deepak / puppet labs / engineering
--
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/20140401174400.GD66086%40bebop.local.
For more options, visit https://groups.google.com/d/optout.