Ask Your Question

Where is the best place to put node definitions when using directory environments?

asked 2014-10-31 11:37:56 -0600

Thomas.Edgar gravatar image

Where is the best place to put node definitions when using directory environments? To me a given node should only be in one place and should not be tied to directory environments. I believe our environment may be overly complex. A given node is currently living in:


Couple things to note. We have only merged <user_dev> to dev (and not from dev to qa, qa to prod, etc) When another <user_dev> joins the team, these permutations will continue, as well as merging the puppet modules to the higher environments. Also, I'd like to see the node definition in a separate file to quickly locate (e.g., using locate -ir <node name="">). My gut feeling this structure is over complicated and possibly wrong.

Your thoughts please.

PS. we use R10k for creating even more directory environments. The list above will continue to grow (ad nauseam).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-31 13:43:18 -0600

cbarbour gravatar image

updated 2014-10-31 13:47:16 -0600

The best solution is not to use node statements. Generally, it's much better to use an external node classifier to separate your node classification from everything else. The reason for this is that node classification tends to be transient, and tends to introduce a lot of configuration churn. Configuration churn is bad if you're trying to create stable environments, and very bad if you're trying to introduce a code review/release process.

A couple of options here:

  • Use an existing ENC. Puppet Enterprise, Foreman, Cobbler, etc can all do this.
  • Write a custom ENC. Useful if you have an existing DCDB.
  • Use Hiera to lookup node classification from an external database.

If you still want to use node statements, directory manifests are probably your best bet. This is the new way to handle site-wide manifests. You can centralize the directory, perhaps outside your node environment?

If you have some environment specific data in your existing site.pp manifests, consider moving it into a module in your environment. Make sure your global manifests include that module.

Here are some resources:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-31 11:30:40 -0600

Seen: 1,618 times

Last updated: Oct 31 '14