Ask Your Question

module best practice: how to use forge modules?

asked 2015-01-29 08:02:46 -0600

oznah gravatar image

What's the best way to leverage well written forge modules? It doesn't seem like you would not want to edit them directly, correct?


You need to configure postfix. You want to use a module from the forge so you run "puppet module install foo/postfix". Obviously there are numerous configs that are unique to your environment. What's the best practice for accommodating unique configs while keeping foo/postix "clean" (for future upgrade or whatever)? Would I create my own module called "myenvironment_postfix" and call foo/postfix and set paramaterized variables, include templates, reference hiera data in my own module? How would you best utilize a forge module?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-29 11:31:58 -0600

lavaman gravatar image

This is precisely why the role/profiles development pattern exists:

edit flag offensive delete link more


I am familiar with the roles/profiles pattern. I guess I never made the connection. So as it relates to my hypothetical, you would have a "profiles::postfix" class where you would assign parameters specific to your environment, correct?

oznah gravatar imageoznah ( 2015-01-29 12:30:45 -0600 )edit

Or use the profile to include the postfix module and hiera to override whatever parameters need it.

rnelson0 gravatar imagernelson0 ( 2015-01-30 13:39:44 -0600 )edit

rnelson0 - that's what I ended up doing. I am just getting started and I am already re-factoring. I only need to override a few params so I created a "profiles::base" for the settings that I want replicated across my whole environment.

oznah gravatar imageoznah ( 2015-01-31 10:12:00 -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


Asked: 2015-01-29 08:02:46 -0600

Seen: 190 times

Last updated: Jan 29 '15