3

Like many (I hope), I am preparing for Puppet 4 by separating out my manifests into environments. I intend on having 3 separate environments: qa, staging, prod. In setting up the manifests initially, I had setup a custom fact for environment to point to the specific environment (i.e. created /etc/facter/facts.d/environment that set environment to prod).

When I run a test using a single manifest that prints out the $environment variable, it gives me the value from my custom fact, but when the agent talks to the Puppet Master, it is still using the default environment "production".

Any idea why this is happening? Is facter not able to be used as an ENC?

3
  • Nope, I haven't been preparing for this. Should I? :)
    – ewwhite
    Oct 20, 2014 at 17:48
  • Well, if you are in the same boat as I am with the default "single manifest" environment, it can be a pain. Or maybe I never fully explored what it was capable of and backed myself into a corner. Either way.
    – Cesar
    Oct 20, 2014 at 17:53
  • 3
    @ewwhite Yup, required in 4.0. Upgrade to 3.7 and watch the deprecation warnings fly ;) Oct 20, 2014 at 17:58

1 Answer 1

4

The $environment variable isn't technically a fact - it is set by the agent from its puppet.conf, instead of a fact. You'll need to edit it in the agent's puppet.conf instead of facts.d.

An ENC can set a node's environment (overriding what the agent selects as its own environment), but the master would need to be the one overriding it, not the agent.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .