How to force a host to run specific puppet environment

Hi,

I have foreman setup with puppet so that the environment is sent from
foreman through node.rb ENC. Is there any way to force puppet agent to use
command line parameter --environment instead of using the one set in
foreman but keeping the other hosts using foreman setting?

When i run "puppet agent -t --environment custom" I get "Warning: Local
environment: "custom" doesn't match server specified node environment
"testing", switching agent to "testing" " and host runs in testing
environment.

Thanks.

That's a puppet thing - if the ENC specifies an environment, it's
authoratative. This is generally regarded as good practice - for example
dev nodes shouldn't be able to simpel add "–environment production" and
get configuration (eb passwords) for all the production systems.

If you're sure you need this, flip the ENC_environment setting in Foreman's
Settings UI to false. This will stop Foreman sending an environment to
all nodes, and agents will be able to specify their own environments.

Ugh, hit Send too fast - meant to say, no, there's no way to do this for a
single node.

Thanks for the quick respond. I was hopping some kind of workaround.
Bummer. Wished puppet allow override it by using the command line parameter
because I prefer keeping all nodes using foreman set env.

··· On Tue, Apr 26, 2016 at 8:21 PM Greg Sutcliffe wrote:

Ugh, hit Send too fast - meant to say, no, there’s no way to do this for a
single node.


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/OxTquCzp-UI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

You could try the NoEnv plugin -
https://github.com/joshuabaird/foreman_noenv - it's packaged for RPM but
not Deb according to the wiki, so it depends which OS you're on :wink:

Greg

··· On 27 April 2016 at 01:29, Alejandro Falcon wrote:

Thanks for the quick respond. I was hopping some kind of workaround.
Bummer. Wished puppet allow override it by using the command line parameter
because I prefer keeping all nodes using foreman set env.

Wow that plugin looks exactly what I was looking for. Thanks again Greg!

··· On Wed, Apr 27, 2016 at 3:14 AM Greg Sutcliffe wrote:

On 27 April 2016 at 01:29, Alejandro Falcon alejandrocfalcon@gmail.com > wrote:

Thanks for the quick respond. I was hopping some kind of workaround.
Bummer. Wished puppet allow override it by using the command line parameter
because I prefer keeping all nodes using foreman set env.

You could try the NoEnv plugin -
https://github.com/joshuabaird/foreman_noenv - it’s packaged for RPM but
not Deb according to the wiki, so it depends which OS you’re on :wink:

Greg


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/OxTquCzp-UI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.