Feature #11248
openAdd 'agent-specified' Puppet environment option for hosts
Description
I use R10k to deploy Puppet environments that are used for testing features. Part of my workflow includes cutting a new Puppet environment and then running several nodes against this environment using "puppet agent -t --environment=test_environment." The problem is that I also have 'enc_environment' set to 'true' so that Foreman enforces the environment for my production hosts. When the ENC enforces the environment, the Puppet agent will not allow you to override it. This prevents me from using 'puppet agent -t --environment=test_environment" on hosts to test my new Puppet code.
Manually importing environments, manually importing classes in these environments (required because Foreman filters classes per environment) and then assigning an individual host to a new environment/class is a very slow process at the moment (over 5 minutes).
PE Console allows you to choose 'agent-specified' for the environment on a host. I'm assuming this keeps the ENC from specifying the environment, allowing one to use 'puppet agent -t --environment=whatever' from the agent. This is good, but we still need to classify the class(es) to the host. Currently, the only way to do this is to a) import the new environment b) import the new classes on the environment (again, a very long process). Perhaps Foreman can disable the host/environment class filtering if a user chooses "agent-specified" for the environment?
I think the following would satisfy my requirements:
- Introduce an 'agent-specified' environment at the host level which would essentially disable 'enc_environment' for that specific host
- Disable filtering on classes per environment if the user chooses 'agent-specified'
Of course, there could be a better way to handle all of this. Thoughts?
Updated by Dominic Cleal over 9 years ago
- Related to Feature #1530: Disabling puppet env in ENC should be an option added
Updated by Josh Baird over 9 years ago
The new 'foreman_noenv' [1] plugin provides the 'agent-specified environment' functionality described in this issue. RPM packages are available in the 1.9 plugin repos.