Hi, I didn't read all of your message, but this first section had me wondering: Are you aware that Puppet resources support actual tags?
@@check_mk::host { 'title': host_tags = [ ... ], tag => 'nat' } You can then easily collect all tagged resources. Check_mk::Host<<| tag == 'nat' |>> The interesting part is that the tags actually *do* form an array, and that the == operator in the collector *will* check to find wether the RHS is in the array. Come to think of it, you might even get away with Check_mk::Host<<| host_tags == 'nat' |>> Have you tried this? Cheers, Felix On 10/15/2014 07:02 PM, Baptiste Grenier wrote: > I am trying to query PuppetDB to filer my nodes to retrieve all the nodes > exporting this Check_mk::Host resources containing a specific value (nat) in > the > host_tags array. > > My ultime goal is to be able to write something like this in my manifests, to > retrieve all the check_mk hosts that are behind NAT: > > ----------8<------------------------------------------------------ > $nat_nodes = query_nodes('@@Check_mk::Host{host_tags = "nat"}') > ----------8<------------------------------------------------------ > > With the = meaning that the nat tag is included in the host_tags array. (I > would love to have a construction like the in operator of the puppet language > [1]...) -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/545A933E.7020101%40Alumni.TU-Berlin.de. For more options, visit https://groups.google.com/d/optout.