38 cards
View
Posted 24 days ago. Visible to the public.

HowTo: let puppet agent run from different branch

This is not encouraged because this change is easily forgotten. We recommend using this only if you know what you are doing.

Should you be in need to run puppet from a branch (called environment in puppet land) other than production for a long time and can't or don't want to disable puppet you can do the following:

Add a new section to /etc/puppetlabs/puppet/puppet.conf on the server that should apply the environment. It usually looks like this:

Copy
[main] < some stuff >

Add the agent section so it looks like this:

Copy
[main] < some stuff > [agent] environment = $environment_name

If you put the environment line below the main section, you might get the following error:

Copy
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named '$environment_name' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound) from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:34:in `push_application_context' from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:363:in `run' from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run' from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute' from /usr/bin/puppet:5:in `<main>'

Owner of this card:

Avatar
Marius Schuller
Last edit:
24 days ago
by Marius Schuller
This website uses cookies to improve usability and analyze traffic.
Accept or learn more