Hi all,

Let's consider the following situation:

I use the module structure, proposed by R.I.Pienaar:
http://www.devco.net/archives/2012/12/13/simple-puppet-module-structure-redux.php

I have a module, let's say apache, that follows that pattern for
installing and setting up basic apache server.

However, I also want to have a way to provide extra configuration for
specific use-cases. Let's call these projects. So for each project, we
want to have some additional class apache::projectX that performs these
additional tasks (e.g. deploys more specific template, defines more file
resources, etc, etc).

My question is this: if I want to stick with a single point of entry to
the module (i.e. manifests include just apache module with some
parameter), what's the best way to go considering that each project
subclass may have its own set of parameters? Defining all these
parameters on the apache class itself, doesn't sound like a good idea.
Perhaps, defining them in Hiera as apache::projetX::parameterY?

The easy solution seems to be to forget about single point of entry and
include from manifests both the apache and the apache::projectX classes
with appropriate parameters. However, in order to ensure proper
sequencing all the apache::projectX classes might need to contain some
code like this:

  Class['apache::config'] ->
  Class['apache::projectX'] ~>
  Class['apache::service']

I don't like the idea of having this in all project-specific classes, as
modification of the module structure might become more difficult - i.e.
will need to change all the apache:projectX classes if I want to add,
let's say, a apache::modules class that needs to load before the projectX.

Any thoughts on a best practice in similar situations?

Regards,
Boyan

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to