Puppet environments..

44 views
Skip to first unread message

John Doe

unread,
May 26, 2016, 9:45:54 AM5/26/16
to Puppet Users
Hey,

I been stuck for a while with this now.

Thing is that I can't understand how tell puppetmaster to issue different environments for the agent. I see in Puppet Enterprise everything is explained very well and detailed, but in open source version everything looks very messy, there is no clear picture how things should look like.

The most confusing part here for me is that how to TEACH puppetmaster identify nodes and then assign them to appropriate environment?


R.I.Pienaar

unread,
May 26, 2016, 9:55:01 AM5/26/16
to puppet-users
you have 2 options, either on the node configure environment in the puppet.conf
or you must have an ENC that sets the node environment.

That's it, ENC docs @ https://docs.puppet.com/guides/external_nodes.html

If you're on latest Puppet you might like a prebuilt one I made @ https://forge.puppet.com/ripienaar/classifier

Courtney Campbell

unread,
Jun 1, 2016, 12:16:56 PM6/1/16
to Puppet Users
I just set this up myself. You need to create your environments directory structures is you haven't already.

/etc/puppet/environment/{dev|prod)/(manifests|modules|environment.conf|hierdata)

Hope you understand that. Then you need to change your puppet.conf on the master. Add these lines under main

environmentpath = $confdir/environments
basemodulepath = $confdir/modules:/opt/puppet/share/puppet/modules

Then under each environement, add this to environment.conf

modulepath = $confdir/environments/development/modules:$basemodulepath
manifest = $confdir/environments/development/manifests/

Now on your agents, just add a line like this under main

environment = development or environment = production.

Now when you run the agent(s), it should pull the data from under the environements manifests directory.
Reply all
Reply to author
Forward
0 new messages