Ask Your Question

Can a headless puppet box have directory environments?

asked 2014-12-02 10:22:54 -0500

AmberW gravatar image

updated 2014-12-02 15:28:25 -0500

I am attempting this on a headless puppet box and am encountering issues. I just want to make sure that this is possible.

Here is a more specific description in the form of an example. If I have two environments: /home/jeoffrey/ and /home/jamie/ then when I run puppet apply /home/jamie/manifests/site.pp then is there a way to automatically have the default modulepath overridden to /home/jamie/modules?


edit retag flag offensive close merge delete


Can you describe the issues in more detail or supply error messages, etc.?

GregLarkin gravatar imageGregLarkin ( 2014-12-02 14:33:50 -0500 )edit

lorcutt gravatar imagelorcutt ( 2014-12-02 15:00:40 -0500 )edit

Yes, you can pass the --modulepath option to puppet apply, e.g. puppet apply --modulepath=/home/jamie/modules /home/jamie/manifests/site.pp. That's not necessarily automatic, but perhaps there's a way to script it so you simply pass the environment name, and the proper command is fired.

GregLarkin gravatar imageGregLarkin ( 2014-12-02 18:35:11 -0500 )edit

Thank you !

AmberW gravatar imageAmberW ( 2014-12-03 10:21:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-03 07:44:08 -0500

llowder gravatar image

If you run puppet as the user jamie then the default $confdir is ~jamie/.puppet.

If you make sure there is a $confdir/puppet.conf and it has basemodulepath and environmentpath (assuming Puppet 3.7.x) set in the [main] section, then that modulepath will be available for puppet apply.

If you don't specify environment in [main] but instead specify it in [agent] it will use the default of production. You can override this by setting environment in the [user] section.

edit flag offensive delete link more


Thanks! This was really helpful!

AmberW gravatar imageAmberW ( 2014-12-03 10:12:34 -0500 )edit

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-12-02 10:22:54 -0500

Seen: 94 times

Last updated: Dec 03 '14