59 cards
Posted over 2 years ago. Visible to the public. Deprecated.

HowTo: let puppet agent run from different branch

We can now manage this in puppet itself for better visibility.

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:

[main] < some stuff >

Add the agent section so it looks like this:

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

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

/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:

Marius Schuller
Last edit:
over 1 year ago
by Marius Schuller
This website uses short-lived cookies to improve usability.
Accept or learn more