If you use puppetdb you can use my puppetdbquery module: http://forge.puppetlabs.com/dalen/puppetdbquery
You will get it as a array of IP addresses though. But should be easier to go from there at least. If you use the future parser it is fairly trivial to convert that to a hash, in the old parser such conversion requires a little more trickery, possibly with some of the stdlib functions. On 19 December 2013 01:55, Pan Luo <luopa...@gmail.com> wrote: > Hi there, > > I'm trying to setup the permissions on mysql database with multiple web > servers using puppet-mysql module. I would like to collect all IPs of the > web servers and run grant on the database server. > > It seems exported resources might help. The only way I can think of right > now is to export the file resources on each web node with IP as the content > and collect them on the db node. Then I have to load those file content > using a custom function. Then generate a hash from them that will be sent > to mysql::server grants variable. > > Is there a easier way to do it? Thanks. > > -- > 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/bfe2880e-0f5c-4f6d-b65b-9e832f4f9510%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- Erik Dalén -- 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/CAAAzDLec-W3JiByPR2V5UuRFpoof1t803mcUmPgfNDLJDrjfEQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.