Hi, Been racking my brain and I don''t think there is a way to do it so I come to the experts. I have a puppet server and a client. Pretty simple - so here is the problem. I have a job that runs on the CLIENT and creates a file. I want puppet to notice when this file changes on the CLIENT and then somehow have the SERVER get the file? I am thinking this is backwards of how puppet runs, but maybe if I have a template file of the same name. When puppet sees that it changes, it replaces the NEW file and then stores the old one back on the server and NOT the client as a backup? Your thoughts? Does it make sense? -Kat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Anderson
2009-Mar-17 18:19 UTC
[Puppet Users] Re: watching a file remotely / trigger a command?
> Been racking my brain and I don''t think there is a way to do it so I > come to the experts. I have a puppet server and a client. Pretty > simple - so here is the problem. I have a job that runs on the CLIENT > and creates a file. I want puppet to notice when this file changes on > the CLIENT and then somehow have the SERVER get the file?Take a look at exported resources: http://reductivelabs.com/trac/puppet/wiki/ExportedResources For a solution that doesn''t require modifying your current Puppetmaster config, you could set up SSH for key-based authentication between your client and server systems. Then you could have a change to the file on the client trigger the execution of scp, to copy the file to the server. Something like this ought to work: file { "/client/file/path": checksum => md5 } exec { "scp /client/file/path server:/server/file/path": subscribe => File["/client/file/path"], refreshonly => true } With refreshonly set to true, the exec resource will only be run with the resource it''s subscribed to changes, and with no source or content specified for the file resource, Puppet will just keep track of when it changes. -Josh --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---