On Thu, Mar 26, 2015 at 11:29 AM, Peter Berghold <salty.cowd...@gmail.com>
wrote:

> I need a push in the right direction.  I have a need to have a subset of
> hosts in my environment "register" themselves to receive rsync updates from
> a central host.  I realize that the right approach is exported resources
> but I'm getting stuck on the actual implementation.
>

Hi!  I'd recommend you look at the wonderful puppetdb-query:
https://github.com/dalen/puppet-puppetdbquery

I use it to extract hostnames from PuppetDB to populate various things.
It's been a long time since I set this up but it should be as simple as
installing the module and doing something like this:

manifests/init.pp:

   $all_hosts = query_nodes('kernel="Linux"')

    file { 'fqdns.txt':
      content   => template('test/fqdns.erb'),
      ensure    => file,
      path       => '/foo/bar/fqdns',
    }

templates/fqdns.erb:

    <%- all_hosts.each do |fqdn| -%>
    <%= fqdn %>
    <%- end -%>

Hope this helps!
Jeffrey.

-- 
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/CAMvPdm1yWn11x0KNf7CVwJ0hDG%3D%3DR4-Wo0po60a-hDH2Qsi90A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to