[Pkg-puppet-devel] Bug#890268: puppet: non-agent commands fail on puppet agent when environment is set

Alex Kiousis alexk at noc.grnet.gr
Mon Feb 12 18:47:33 UTC 2018


Source: puppet
Version: 4.8.2-5
Severity: normal

Dear Maintainer,
puppet4 seems to always look inside 'environmentpath' for the currently
configured environment before doing any operation.
This doesn't make sense when a host acts as an agent.

By default environmentpath is set to '/etc/puppet/code/environments'.

Running any puppet command (except puppet agent) with an environment set
fails like this:

puppet config print --environment=testaki
/usr/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'testaki' anywhere in the path: /etc/puppet/code/environments. Does the directory exist?  (Puppet::Environments::EnvironmentNotFound)
	from /usr/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in `push_application_context'
	from /usr/lib/ruby/vendor_ruby/puppet/application.rb:337:in `run'
	from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
	from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
	from /usr/bin/puppet:5:in `<main>'

Running puppet agent works fine though.

Our puppet.conf looks like this:
[main]
logdir = /var/log/puppet
vardir = /var/lib/puppet
ssldir = /var/lib/puppet/ssl
rundir = /var/run/puppet
factpath = $vardir/lib/facter
ca_server =  <FQDN>
server = <FQDN>

Creating an empty directory named after the environment under environmentpath
seems to workaround this problem.



More information about the Pkg-puppet-devel mailing list