Ask Your Question
0

Assigning modules from environment folders

asked 2013-12-05 04:22:16 -0600

Quindoo gravatar image

Hi,

I installed Puppet Open Source using the Foreman installer and I am not sure if it comes with the Foreman installer only but it contains different environments under /etc/puppet/environments. Two of these environments are common and production. Now I was wondering how the modules are being assigned from the different environments.

I assume that /etc/puppet/environments/common should contain only the basic modules that are spread over different environments.

But how does Puppet assign the modules to a specific node. Let's say, that the node is configured in the production environment. And there is a ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-10 10:41:05 -0600

Your multi-environment modulepath is only in the block that effects the puppet master runs.

copy the module path line into each of the environment blocks, like this:

[master]
modulepath = $confdir/environments/$environment/modules:$confdir/environments/common:$confdir/modules
manifest = $confdir/manifests/unknown_environment.pp

[production]
modulepath = $confdir/environments/$environment/modules:$confdir/environments/common:$confdir/modules
manifest = $confdir/manifests/site.pp

[development]
modulepath = $confdir/environments/$environment/modules:$confdir/environments/common:$confdir/modules
manifest = $confdir/manifests/site.pp

One comment: "$confdir/environments/common" seems unnecessarily redundant. Your common module code will be in "$confdir/modules"

edit flag offensive delete link more

Comments

Thank you, I changed it like you said, and every environment consists of 'modulepath = $confdir/environments/$environment/modules:$confdir/modules now. But isn't it better to put it in ...(more)

Quindoo gravatar imageQuindoo ( 2013-12-11 08:25:02 -0600 )edit

Good point. I never trieed it that way. I am not sure how it would work if modulepath is defined in [main] and again in an environment block. The definititions ...(more)

LinuxDan gravatar imageLinuxDan ( 2013-12-11 09:57:44 -0600 )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

Stats

Asked: 2013-12-05 04:22:16 -0600

Seen: 556 times

Last updated: Dec 10 '13