Sans
2011-Aug-16 07:59 UTC
[Puppet Users] copying files to the agent that matched hostname
Dear all, I need to copy some files to the various clients in some logical way. The files are named in this way: "farm001-cert.pem", where the forst part of the name (i.e. nfarm001) is the name of host where it should be copied. How can I do that? Any help greatly appreciated. Cheers!! -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-Aug-16 14:38 UTC
[Puppet Users] Re: copying files to the agent that matched hostname
On Aug 16, 2:59 am, Sans <r.santanu....@gmail.com> wrote:> Dear all, > > I need to copy some files to the various clients in some logical way. > The files are named in this way: "farm001-cert.pem", where the forst > part of the name (i.e. nfarm001) is the name of host where it should > be copied. How can I do that? Any help greatly appreciated. Cheers!!You can interpolate the ''hostname'' fact into the name of the resouce, the name of the file on the file server, or both. For example: file { "${hostname}-cert.pem": ... source => "puppet://puppet.internalnet/modules/certs/${hostname}- cert.pem" } John -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Sans
2011-Aug-16 18:46 UTC
[Puppet Users] Re: copying files to the agent that matched hostname
Thanks John! Is $hostname a puppet built-in variable like $operatingsystem, $fqdn etc? -San On Aug 16, 3:38 pm, jcbollinger <John.Bollin...@stJude.org> wrote:> > You can interpolate the ''hostname'' fact into the name of the resouce, > the name of the file on the file server, or both. For example: > > file { "${hostname}-cert.pem": > ... > source => "puppet://puppet.internalnet/modules/certs/${hostname}- > cert.pem" > > } > > John-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Martin Alfke
2011-Aug-17 06:49 UTC
Re: [Puppet Users] Re: copying files to the agent that matched hostname
Hi San, On 08/16/2011 08:46 PM, Sans wrote:> Thanks John! Is $hostname a puppet built-in variable like > $operatingsystem, $fqdn etc?These varaibles are made available to puppet by facter. You can run facter on command line to see facter output. Regards, Martin> > -San > > On Aug 16, 3:38 pm, jcbollinger <John.Bollin...@stJude.org> wrote: >> >> You can interpolate the ''hostname'' fact into the name of the resouce, >> the name of the file on the file server, or both. For example: >> >> file { "${hostname}-cert.pem": >> ... >> source => "puppet://puppet.internalnet/modules/certs/${hostname}- >> cert.pem" >> >> } >> >> John >-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.