FAQ

On Mon, 2013-01-28 at 11:00 -0600, Ti Leggett wrote:
On Jan 28, 2013, at 10:56 AM, Calvin Walton wrote:

The fix is trivial, just add an "include apache::params" (or even just
"include apache") at the top of your kibana::apache class, like so:

# modules/kibana/manifests/apache.pp
class kibana::apache (
$version = $kibana::params::parameters['version'],
) {
include apache::params
@file { $kibana::params::apache_config:
...

However, this conflicts with the class {} style declarations in your
apache/manifests/init.pp file. For best results, you should switch those
to use the "include" method as well.

Thanks for the response.

Can multiple classes include the same class. Let's say I instantiate
the apache class from manifests/nodes.pp which in turns includes
apache::params. Can kibana include apache::params then as well with no
conflict. I know you can't do this with the class {} style
declarations. Also, I thought the class {} style declarations were the
preferred way or is that just in the nodes.pp file?
Yes, with the "include" syntax, you can include a class multiple times
from different places with no conflicts. It's a no-op if the class is
already included.

The "include" method is the preferred syntax (in my opinion, but I'm
sure other share it), due to this feature - particularly if you're using
hiera to pull configuration in. The only time you should be using the
class {} syntax is if you need to pass in class parameters and can't use
hiera.

--
Calvin Walton <calvin.walton@kepstin.ca>

--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 19 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJan 28, '13 at 4:26p
activeJan 31, '13 at 2:39p
posts19
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase