Bug #3517

Puppet silently passes out production environment manifests when requested environment is unknown.

Added by Paul Lathrop about 2 years ago. Updated about 2 years ago.

Status:Rejected Start date:04/07/2010
Priority:Normal Due date:
Assignee:Luke Kanies % Done:

0%

Category:compiler
Target version:2.6.0
Affected Puppet version:development Branch:
Keywords:
Votes: 1

Description

When a client checks in to the puppetmaster asking for a specific environment, if that environment is undefined in the puppetmaster’s configuration file, the puppetmaster silently passes out configurations from the production environment.

We discussed this on the mailing list: http://groups.google.com/group/puppet-users/browse_thread/thread/7df9d80bc55cf4ae/7f331374d08a0cce and seem to have reached consensus that this is a non-ideal behavior.

I think that at a bare minimum this should produce a Warning, ideally I believe it should be an error.

History

Updated by James Turnbull about 2 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies

Updated by Luke Kanies about 2 years ago

  • Category changed from server to compiler
  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Luke Kanies)
  • Target version set to 2.6.0

Updated by Luke Kanies about 2 years ago

The behaviour I’m currently getting is an exception:

err: Could not parse for environment foobar: Could not find file /tmp/foo/manifests/site.pp
err: Could not parse for environment foobar: Could not find file /tmp/foo/manifests/site.pp

Of course, this won’t be the case if you have a default site.pp file or something, but in cases where you have per-environment manifests, it seems to behave correctly.

Updated by Luke Kanies about 2 years ago

  • Status changed from Accepted to Needs More Information
  • Assignee set to Luke Kanies

I can only see this being the case if your default information (i.e., what you get if you have no environment-specific information specified) is the same as your production information. If your config looks like this:

[main]
manifest = /foo/site.pp

[dev]
manifest = /bar/site.pp

Then yeah, anything other than ‘dev’ gets /foo/site.pp, including “invalid” environments.

The only way to fix this in 0.25 is to not use the default values as one of your environments; I’ve confirmed that this will throw an error.

However, this isn’t currently working in master, so I don’t know what we’ll do there.

Updated by Paul Lathrop about 2 years ago

  • Affected Puppet version changed from 0.25.4 to development

Luke Kanies wrote:

I can only see this being the case if your default information (i.e., what you get if you have no environment-specific information specified) is the same as your production information. If your config looks like this: […] Then yeah, anything other than ‘dev’ gets /foo/site.pp, including “invalid” environments.

The only way to fix this in 0.25 is to not use the default values as one of your environments; I’ve confirmed that this will throw an error.

However, this isn’t currently working in master, so I don’t know what we’ll do there.

I hadn’t thought we were doing that but I went and checked and sure enough…

So, yeah, I think we should fix it in master, but I’ve just confirmed it isn’t broken in 0.25.4

Updated by Luke Kanies about 2 years ago

  • Status changed from Needs More Information to Rejected

Given that this is more of a configuration problem than Puppet problem, I’m going to reject.

I agree this would be nice to fix, but it’s more a question of how to handle invalid environments than Puppet’s behaviour in the case of this configuration problem.

Also available in: Atom PDF