Ask Your Question

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

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

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

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

SimonH gravatar image

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

I've found a possible solution to this - once I'd realised that the apache::mod::* ( 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

  - 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 :


# 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



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

Seen: 513 times

Last updated: Sep 02 '15