Open danielserrao opened 5 years ago
wget::fetch { 'package.msi': source => "https://api-host.com/packages/package.msi", destination => "C:\\Program Files\\package.msi", user => $api_user, password => $api_password, nocheckcertificate => true, }
The resource is being executed on every puppet run even when the package.msi already is in the correct directory.
Only execute the resource when the package is not in the directory.
In the wget module, this problem seems to be happening in the manifests/fetch.pp on the code:
if ($::operatingsystem == 'windows') { $exec_path = $::path $unless_test = "cmd.exe /c \"dir ${_destination}\"" } else { ... }
The problem seems to be related to the path space, I think one possible solution could be something like:
$unless_test = 'cmd /c IF exist "${_destination}" (exit 0) ELSE (exit 1)'
or simply allow the user to define is own unless command on Windows.
unless
How to reproduce (e.g Puppet code you use)
What are you seeing
The resource is being executed on every puppet run even when the package.msi already is in the correct directory.
What behaviour did you expect instead
Only execute the resource when the package is not in the directory.
Any additional information you'd like to impart
In the wget module, this problem seems to be happening in the manifests/fetch.pp on the code:
Suggestion
The problem seems to be related to the path space, I think one possible solution could be something like:
or simply allow the user to define is own
unless
command on Windows.