On Sep 18, 2009, at 18:30 EDT, Disconnect wrote:
> > (Wow, hi Luke! LTNT!) Yes, it has! > > The standard way to do that is: > source => > ["puppet:///foo/file-$hostname","puppet:///foo/file-$lsbdistcodename > ","puppet:///foo/file"] > - check for modules/foo/file-www4, then file-jaunty, then file > As I understood source arrays, would only grab the first one to succeed, Type Reference says "If you specify multiple file sources for a file, then the first source that exists will be used.". Is that page out of date? Luke > On Fri, Sep 18, 2009 at 4:37 PM, Luke Schierer <luke.schie...@gmail.com > > wrote: >> I am looking at migrating a set of servers from cfengine management >> to >> puppet management. For the most part, the move has been relatively >> straight >> forward, and I am pleased with the way that puppet's modules have >> made some >> of the things I did in cfengine2 much cleaner. There is one thing >> though >> that was relatively easy in cfengine that I am not seeing a good >> way to >> achieve with puppet. >> >> In cfengine I defined a variable serverlist that was essentially an >> array of >> hostnames. I then had the following copy block >> >> copy: >> somehost:: >> /path/to/file/that/updates/nightly >> server=${serverlist} >> dest=/var/www/repository/${this} >> mode=644 owner=apache group=wheel >> >> which caused the one host in the class somehost to copy the file >> from each >> server in the array serverlist to the repository. >> >> The closest I see in puppet would be to list each server source as a >> different file entry in a class. >> >> Something like (psuedo code) >> >> class pullfile { >> File { ensure => file, owner => apache, group => wheel, mode => >> 644, } >> file { >> host1: source => "puppet://host1/path/to/file" path => >> "/var/www/repository/host1"; >> host2: source => "puppet://host2/path/to/file" path => >> "/var/www/repository/host2"; >> } >> } >> >> and have puppetmaster on each host. >> >> Is there a better way? >> >> Thanks! >> >> Luke > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---