David,how does the code you provided handle the removal of a "source" node ? as far as i can tell the directory that contains the concatenated_file_parts doesn't get purged on each puppet iteration.so even after the "source" node stops exporting its file_part the Concatenated_file will contain its entry. Maybe some time-stamp magic is needed here ...
David Schmitt wrote: > robbyt wrote: > >>> Hi All, > >>> I'm successfully using Exported Resources and StoreConfigs on my > >>> puppet system. I'm able to populate the hosts files on all of my > >>> nodes, and that's pretty cool. > >>> My problem is that i'm not quite clear how to query the information > >>> stored in the Exported Resources database for other things. e.g., I > >>> want to setup Postfix to allow relay from _all_ of the IPs that facter > >>> has reported to the puppet master. How can I pull all of the IPs from > >>> the database and turn them into puppet variable array? > > > > On Aug 25, 5:19 am, Stefano Harding <shard...@ebrary.com> wrote: > >> I too would like to know how to pull like this from the stored config > >> db... > >> > >> - Stefano > >> > > > > I'm glad someone else out there feels the same way about Exported > > Resources. I've resulted to using exported resources in a manifest to > > have the local puppet on the puppetmaster write templates for other > > modules which then get picked up by other nodes. > > > > Messy stuff. > > > > There has to be a better way to do this without manually defining all > > of my IP addresses in variables? > > Why don't you collect and build those things directly on the node where > you need it? > > Use something like the concatenated_file define[1]: > > source: > > @@concatenated_file_part { "$ipaddress": > dir => "/var/lib/puppet/ips", > content => "$ipaddress\n", > tag => 'ip' > } > > target: > > Concatenated_file_part <<| tag == 'ip' |>> > concatenated_file { "/etc/iplist": > dir => "/var/lib/puppet/ips", > } > > This gives you a list of all $ipaddresses in /etc/iplist on the target. > > Regards, DavidS > > [1]http://github.com/puppet-modules/puppet-common/blob/0caa32db1aaad6dabc9542c5e0aa20e76ea94f48/manifests/defines/concatenated_file.pp --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---