Ask Your Question

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

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

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 -0500

cbarbour gravatar image

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

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 -0500

Seen: 770 times

Last updated: Oct 31 '14