Reg : File Change Checking

55 views
Skip to first unread message

krishna bhaskara rao

unread,
Dec 17, 2012, 7:03:38 AM12/17/12
to puppet...@googlegroups.com, krishnabha...@yahoo.com
Hi,

I am using below script to move files from puppet master to puppet agent.
file { "/usr/local/temp":
               ensure => "file",
               source => "puppet:///files/temp",
                mode   => 777,
}
If I use this script, file always transferring from master to agent.
But my requirement like, if is there any changes in file then only have to transfer file from puppet master to puppet agent.
Is it possible can you me any as early as possible ?.

With Regards,
Krishna.

薛 鹏飞

unread,
Dec 17, 2012, 9:49:43 AM12/17/12
to puppet...@googlegroups.com

Sincerely,
Pengfei Xue

i search mail list, and find this, you can add checksum => md5  to your file resource, this will ask for updating only if the file changed

With Regards,
Krishna.


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/utIvv7HGzuYJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

jcbollinger

unread,
Dec 18, 2012, 9:33:13 AM12/18/12
to puppet...@googlegroups.com


That resource declaration says: "the target node should have a file /usr/local/temp, with mode 777 (octal), whose content exactly matches the content currently available from URL puppet:///files/temp (which refers to the built-in file server on the master that served the catalog)."  The Puppet agent will check on every run whether the declaration is already satisfied, and will update the target file as necessary to make it comply.  The agent will not download the file again if it already matches, but it will do if the file has changed on either side.

By default, Puppet checks for matching file content by computing and comparing md5 checksums (so specifying that explicitly is unnecessary).  The client computes the one for its local file, and the master computes and reports the one for the remote file.

There are several ways to modulate Puppet's behavior here by changing or adding to your declaration, but to recommend anything we need to be sure we know what your real requirements are.  The behavior you say you want sounds very much like what Puppet does by default, so if it's really behaving differently then there must be something you're not telling us.


John

Reply all
Reply to author
Forward
0 new messages