Ask Your Question
0

using hiera to define list of modules to install for puppetlabs-apache

asked 2015-09-02 05:33:31 -0500

SimonH gravatar image

Is there anyway to get a list of apache modules from hiera (which might include those where specific classes already exist within puppetlabs-apache such as apache::mod::info ) and also setup configuration for those modules.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-02 08:31:24 -0500

SimonH gravatar image

updated 2015-09-02 08:49:17 -0500

I've found a possible solution to this - once I'd realised that the apache::mod::* (https://forge.puppetlabs.com/puppetla...) are classes, so I can include them in the list of classes at the top of the hiera definition.

For the remaining modules that don't have a specific class, I've created a hash in the module and just use a create_resources in my wrapper module that calls apache.

hiera file:

--- classes:
  - apache_wrapper
  - apache::mod::info
  - apache::mod::ldap

apache_wrapper::modules:
  - authz_groupfile

and then I just have the following as part of my apache_wrapper class to handle the modules that don't have predefined classes :

init.pp

#-------------------------------------------------------------------------
# Install modules

$modules = hiera('apache_wrapper::modules', '')
if ($modules != '') {
    apache::mod { $modules : }
}
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

Stats

Asked: 2015-09-02 05:33:31 -0500

Seen: 293 times

Last updated: Sep 02 '15