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.

Reply via email to