On Nov 3, 5:28 am, Russell Howe <rh...@moonfruit.com>
wrote:> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 02/11/11 22:15, Douglas Garstang wrote:> Ok, what am I doing wrong
here? I''m including
> > splunkforwarder::app_server and it''s all working except that
it
> > appears that splunkforwarder::common isn''t including
> > splunkforwarder::enabled...
>
> > class splunkforwarder::enabled {
> > service {
> > ''splunkforwarder'':
> > ensure => running,
> > enable => true,
> > hasrestart => true,
> > hasstatus => true;
>
> ^
> This should be either not here or a comma
No, the semicolon is ok. It separates the resource definition from a
possible subsequent one within the same block, as in
service {
''foo'':
enable => true;
''bar'':
enable => false;
}
The following resource declaration may be omitted entirely, as Doug
has done -- this is analogous to including a trailing comma after the
last parameter of a parameter list. Besides, Doug wrote that it
worked (read: compiled successfully), but the "include
splunkforwarder::enabled" did not appear to be honored.
I don''t see anything inherently wrong with the manifests presented,
but I do observe that as a matter of style, class inheritance should
be used *only* for overriding resource properties. In the example
manifests, splunkforwarder::common contains no resources to override,
so splunkforwarder::app_server should "include" instead of inheriting
it.
Wild guess: is splunkforwarder::app_server trying to override
properties of Service[''splunkforwader''] (from class
splunkforwarder::enabled, which is included by
splunkforwarder::common)? That would not work, because the resource
is not defined by the parent class. Remember always that the
''include'' function is *not* analogous to the C
preprocessor''s #include
directive: it does not perform interpolation. In some ways, Puppet''s
''include'' is more like Python''s
''import'', but that''s not a perfect
analogy either because ''include'' does cause the specified
class to be
included in nodes'' catalogs (that being it''s primary purpose,
in
fact).
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.