Skip to content
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

wget idempotency issue on Windows #103

Open
danielserrao opened this issue Dec 20, 2018 · 0 comments
Open

wget idempotency issue on Windows #103

danielserrao opened this issue Dec 20, 2018 · 0 comments

Comments

@danielserrao
Copy link

  • Puppet: 5.5.6
  • OS: Windows 2016
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

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,
}

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:

if ($::operatingsystem == 'windows') {
  $exec_path = $::path
  $unless_test = "cmd.exe /c \"dir ${_destination}\""
} else {
...
}

Suggestion

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant