On Tuesday, April 16, 2013 3:52:40 AM UTC-5, Boyan Tabakov wrote:
>
>
> It is not website related components, but indeed web-server - vhost 
> definitions, special apache configuration files (e.g. module 
> configuration overrides, etc). Besides, the apache was just an example, 
> I have other cases where similar setup is required. In any case, the 
> project-specific definitions are *only* for resources, directly related 
> to the module in question (in this case, apache). 
> [...]
> If single point of entry can be avoided, then what do you think about 
> the second part of my question? : 
>
> > 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'] 
>
>
[... which carries maintenance costs typical of such boilerplate 
repetition.]

It sounds to me like requiring an explicit declaration for each project 
class is the way to go.  As I said already, however, that's entirely 
unrelated to the question of avoiding repetitive declaration patterns.

You might be able to use collections to solve this problem.  Proceed 
carefully, as Puppet has at times had issues with collecting classes (as 
opposed to ordinary resources), but the basic idea would be for 
Class['apache'] to contain something along these lines:

Class['apache::config'] -> Class<| tag == 'apache::project' |> ~> 
Class['apache::service']

That way, you have the needed relationship declarations in one central 
place.  It should not cause project classes that you have not otherwise 
declared to be declared, and I don't think it will be sensitive to the 
order of your declarations.  You will probably find that you need to tweak 
that somewhat to get it to work is you want, however.  You might find that 
it helps to require each (top) project class to explicitly tag itself with 
some well-known tag.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to