Ask Your Question

Apply a group of modules before other modules?

asked 2014-12-15 13:57:54 -0600

mtravis gravatar image

I'm using Puppet Enterprise 3.7. I'm also fairly new to using Puppet so bare with me if I don't describe things properly.

I have a few modules that installs the required local repositories, dependencies, host files, resolv files that other modules require.

Is there a way to use the contain pattern to install certain modules before others?

Right now I have to run 'puppet agent --test' on the node 3 or 4 times before the required configurations and packages are installed before my other modules work. I would prefer not to use the 'before, require, notify, subscribe' in all my other modules just so things apply in the right order.

I would prefer something like this: Install module a first. Install module b second. Install module c third. Install all other modules.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-12-15 18:38:06 -0600

cbarbour gravatar image

Given your requirements, Run Stages are probably the correct solution. It makes sense to define a run stage to setup your Yum Repositories. You might also create a run-stage to handle certain base dependencies.

Try to avoid over-using run stages; they have a few major limitations and can easily create dependency loops, especially with auto-require resource dependencies.

Be aware that run-stages are also very sensitive to containment. Any resource or class that is not properly contained will become a child of the main stage, rather than the expected run-stage.

I advise testing with the random ordering engine to make sure everything works the way you expect.

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-12-15 13:57:54 -0600

Seen: 250 times

Last updated: Dec 15 '14