Hi All, I''m trying to implement a template (for my collectd config) that gives different results depending on the other modules included on that machine. I tried to do this by checking for the class tags but it turns out that due to bug #3049 this is a huge pain and 90% of the time the tags aren''t registered by the time the template is parsed so I don''t get my expected result. I''m running Puppet 2.6.2 and MCollective 1.0 (a workaround using mcollective would be perfectly viable for me). Does anyone have any suggestions to workarounds for this? I can think of a possible few, none of which are particularly clean though and I don''t wish to reinvent the wheel if someone already has a nice fix. Thanks -- 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.
On Thursday, February 3, 2011 at 9:53 AM, Adam Gibbins wrote: Hi All,> I''m trying to implement a template (for my collectd config) that gives different results depending on the other modules included on that machine. > I tried to do this by checking for the class tags but it turns out that due to bug #3049 this is a huge pain and 90% of the time the tags aren''t registered by the time the template is parsed so I don''t get my expected result. >Use multiple collectd configuration files if you possibly can. Then each class can manage its own little corner of collectd. Putting Include "/etc/collectd.d/*.conf" in your main /etc/collectd.conf should make this possible if it isn''t by default. Rich -- 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.
Add a fact that''s derived from parsing /var/lib/puppet/state/classes.txt. It will be exactly one run behind, but it will have the complete list of classes as of the previous run and it''s reliable. On Feb 3, 2011, at 9:58 AM, Richard Crowley wrote:> On Thursday, February 3, 2011 at 9:53 AM, Adam Gibbins wrote: > >> Hi All, >> I''m trying to implement a template (for my collectd config) that gives different results depending on the other modules included on that machine. >> I tried to do this by checking for the class tags but it turns out that due to bug #3049 this is a huge pain and 90% of the time the tags aren''t registered by the time the template is parsed so I don''t get my expected result. > Use multiple collectd configuration files if you possibly can. Then each class can manage its own little corner of collectd. Putting > > Include "/etc/collectd.d/*.conf" > > in your main /etc/collectd.conf should make this possible if it isn''t by default. > > Rich > > -- > 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.-- 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.
On 3 February 2011 17:58, Richard Crowley <r@rcrowley.org> wrote:> On Thursday, February 3, 2011 at 9:53 AM, Adam Gibbins wrote: > > Hi All, > I''m trying to implement a template (for my collectd config) that gives > different results depending on the other modules included on that machine. > I tried to do this by checking for the class tags but it turns out that due > to bug #3049 this is a huge pain and 90% of the time the tags aren''t > registered by the time the template is parsed so I don''t get my expected > result. > > Use multiple collectd configuration files if you possibly can. Then each > class can manage its own little corner of collectd. Putting > > Include "/etc/collectd.d/*.conf" > > in your main /etc/collectd.conf should make this possible if it isn''t by > default. > > Rich >This could work, although I''d have to modify all my modules that require graphing to call collectd which would be somewhat annoying and would stop the module being so standalone (e.g. we couldn''t change monitoring systems so easy). On 3 February 2011 18:14, Brian Gallew <geek@gallew.org> wrote:> Add a fact that''s derived from parsing /var/lib/puppet/state/classes.txt. > It will be exactly one run behind, but it will have the complete list of > classes as of the previous run and it''s reliable. >I considered this, though as you say the run is going to be delayed which is a little annoying as our puppet runs are only once every half hour. So I''d have to wait an hour for graphing, also seems not as clean as it should be. -- 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.
On Feb 3, 2011, at 10:22 AM, Adam Gibbins wrote:> On 3 February 2011 18:14, Brian Gallew <geek@gallew.org> wrote: > Add a fact that''s derived from parsing /var/lib/puppet/state/classes.txt. It will be exactly one run behind, but it will have the complete list of classes as of the previous run and it''s reliable. > > I considered this, though as you say the run is going to be delayed which is a little annoying as our puppet runs are only once every half hour. So I''d have to wait an hour for graphing, also seems not as clean as it should be.Welcome to my life. I''m building Nagios and ssh configs off of class data, and both suffer from this issue. If it helps, it''s only annoying when you think about it. 8-/ -- 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.