-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File does not get updated when the file is updated #52
Comments
I'm having the same issue. Using the v1.7.0 release. |
Using cache it calls wget with -P, you can get the full command line running puppet win debug mode and see if calling wget directly the behavior is the same. For the notification see #48 |
I think I understand why this is happening I guess. I can see the command line. The behavior isn't what I initially expected. I have the following snippet: wget::fetch { 'http://example.com/path/to/file':
destination => '/local/path/to/file',
cache_dir => '/var/cache/wget',
} This grabs the file fine and updates when the file is changed. Except it execs / notifies every time the puppet agent runs. Removing the cache_dir doesn't cause the subsequent notifications after the initial file placement, but also doesn't update the file when it is new on the web server. Ultimately what I'm trying to mimic is if I were able to specify an http url in a file resource definition as if it were being delivered via the puppet file server or nfs. It's likely this is just he wrong way to go about it. In #48 subscribing to the resulting file in the wget::fetch definition gives me an error with Puppet 4.2 of "Error: Failed to apply catalog: Found 2 dependency cycles:". |
the exec inside wget will always be executed to check if the remote file has changed, that's why it emits a refresh |
To sum up, file does get updated when the http file is updated, you just need to use This has become a dupe of #48, about how to subscribe to events when the file is updated |
My code:
wget::fetch { 'somefile':
source => "someURL",
destination => "destFilePath/fileName",
timeout => 0,
verbose => false,
}
When I alter the destination file, puppet run does not revert my destination file back to the source file.
When I alter the source file, puppet run does not update my destination file with the latest update.
The only time it fetch for the file is when I remove the destination file....Is there a way that I could use this module to pull the file similar to "file" resource type? I am not able to use the "File" resource because it is not located inside the Puppet master server.
I also try to put in the cache_dir:
wget::fetch { 'somefile':
source => "someURL",
destination => "$destFilePath/fileName",
cache_dir => '/var/cache/wget',
timeout => 0,
verbose => false,
}
Using the cache_dir works great!! But if the source and destination files are identical, the "wget:fetch" still run as normal. That would give Puppet a false alert that "something" change.
The text was updated successfully, but these errors were encountered: