Hello guys,


I use stages for defining a kind of order about how the things are done in
my automations. I’ve defined four different stages: boot, os, service and
online. We also have Main stage. The issue I found today may be derived from
a incorrect usage of class inheritance, or run stages. Let me show you an
example:



We use rsyslog for both systems logging and application logging. So,
depending of the facilities and so on, we transport operating systems logs
to a syslog receiver, or stats to a data analysis cluster. So, given that is
the same piece of software I decided to create a module called “rsyslog” and
inside init.pp describe all the necessary stuff for having the operating
systems syslog configured, what is a must in any of my nodes. I also defined
inside stats.pp a new class named “rsyslog::stats” that inherits rsyslog.
So, then, in my node class named “frontend” where I need both configurations
I define the rsyslog class it in this way:



include stages

class { ‘rsyslog::stats’: stage => ‘os’ }



But today I found (using debug option) that the things explicitly defined in
“rsyslog::stats” are done in the stage “os”,  but the things defined in the
class “rsyslog” are done in Main [1]. What I expect? I expect that given
that “rsyslog::stats” was defined in the Stage “os”, the inherited one, too.
I’ve fixed this by defining the class in the node like:



include stages

class { ‘rsyslog’: stage => ‘os’ }

class { ‘rsyslog::stats’: stage => ‘os’ }



But this means repeating lines and it’s quite ugly. I don’t know if that’s
the proper way of doing what I’m doing. I’m using class inheritance because
there are servers that are running rsyslog for systems logs, but they don’t
need the stats configuration (a database server, for example), so including
just “rsyslog” class and defining its run stage should be enough.



Any idea how to get rid of this behavior? I’m using Puppet 2.6.3, and I know
it’s quite old, but I haven’t found any information regarding to this, or
any bug already reported. Potentially, I’m not searching for the correct
words, but anyways, other ideas about how to accomplish with that modular
configuration are welcome.



Regards,





[1]

debug: /Stage[main]/Rsyslog/File[/etc/default/rsyslog]/notify: subscribes to
Service[rsyslog]

debug: /Stage[main]/Rsyslog/Service[rsyslog]/require: requires
Package[rsyslog]

debug: /Stage[main]/Rsyslog/Service[rsyslog]/require: requires
File[/etc/rsyslog.conf]

debug: /Stage[main]/Rsyslog/File[/etc/default/rsyslog]: Autorequiring
User[root]

debug: /Stage[main]/Rsyslog/File[/etc/rsyslog.conf]: Autorequiring
User[root]



--

Ricardo Bartolomé Méndez

Systems Engineer

+34.672.194.729

tuenti.com

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to