Hi all,Does anyone know of a way to inspect resources that are already parsed in a node's manifest during catalog compilation? This would certainly need some serious Ruby Fu.
As an example, imagine I have a number of arbitrary files defined by multiple classes and it is impossible to get an all encompassing list of these files:file { 'woof': }file { 'cows': }file { 'meow': }...$all_files = inline_template(...)I would like to be able to gather those file names into a Puppet variable - this would be parse order dependent. It would be fantastic if it could handle exported resources that have just been collected as well.
I'm taking shortcuts in my spare time with a tool that's probably 70% right for the job. It's for monitoring - I really like the idea of a Puppet module to describe or advertise how to monitor itself, it keeps them very self contained.Just a bit more on this - I generally see three categories of monitoring tools. Ones that are configured separately from your CRM and end up being a source of truth on their own are in my mind the worst. The next level up are ones either defined from or derived from your CRM. The best are auto-discovery, but they cost an absolute fortune. I'm trying to move my team from the first one to the second one with as little "new tools" as possible, which is where the "70% right for the job" comment comes from.I'm using exported resources to describe how modules are monitored. The problem is that exported resources are not the equivalent of raw information passing. So when I want to start doing trickier things like group and analyse what is collected, exported resources don't cut it because it's not what they are designed for.Specifically what I was trying to do was collect exported resources of the same type and group them on the monitoring server. There is no predefined list of service names anywhere (unless you parse the node definitions) so that's why I wanted to go from resource collection to Array of Strings. A colleague has managed to reduce my 300 lines to 50 though so the need for craziness is reduced somewhat. We still need to do the "Export a File" trick and run a script on the monitoring server to build the complex configuration that exported resources are not designed to handle.The next iteration of this work might be to scrap resource collection in favour of querying PuppetDB directly to figure out what to monitor, but that's a lot more work than I'm prepared to do at this stage. Maybe in a few months... ;-)
The next iteration of this work might be to scrap resource collection in favour of querying PuppetDB directly to figure out what to monitor, but that's a lot more work than I'm prepared to do at this stage. Maybe in a few months... ;-)-Luke
--To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/OLpl0Bx1q5kJ.
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
I put my monitoring (and firewall rules incidentally) into each class on a node and import into my monitoring server (nagios currently but intend on switching to icinga soon) them based on tags.I was using global vars but are currently rewriting my modules to use heira to set the monitoring server and a few other settings.This is working nicely for me.I had a few different ideas along the way but my current iteration is getting close to awesome.It also gives me fine grained control over whether a node gets sms alerts or escalation and such.
John
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/L5WxTz43T8sJ.