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

Puppet Ensure Latest not finding the latest package. #67

Open
agray2 opened this issue Jul 7, 2015 · 1 comment
Open

Puppet Ensure Latest not finding the latest package. #67

agray2 opened this issue Jul 7, 2015 · 1 comment

Comments

@agray2
Copy link

agray2 commented Jul 7, 2015

Hello. I am trying to make sure the latest package is installed using the Puppet Package resource, and chocolatey provider. Every time the puppet agent checks in with the Puppet Master, we want to make sure that the app installed on the client is at the latest version. Here is the specific code inside our Puppet Installer class:

package { $appName:
ensure => latest,
provider => 'chocolatey',
source => $servicePackageRepo,
install_options => [ '-packageparameters', "$appRoot$appName\deploy.properties"]
}

When this executes, I find puppet running this command to find the latest version:

Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd version TaskManager | findstr /R "latest" | findstr /V "latestCompare" '

This always results in a null return:

Debug: /Stage[main]/Profiles::Taskmanager::Install/Package[TaskManager]/ensure: TaskManager "1.1.3" is installed, latest is nil

I extracted this command from the debug output and ran it myself, but added the source directory where our nupkg packages are located on the local machine:

'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd version TaskManager –source C:\ProgramData\MorphoTrust\PuppetDeploy | findstr /R "latest" | findstr /V "latestCompare"

This then successfully returned the latest version found in that directory. Is there a way to get the source into the command Puppet uses to find the latest version? Or is there something else that I should be doing to ensure the latest package is always installed?

@ferventcoder
Copy link
Contributor

Hello. It doesn't appear you are using a recent version of this provider. You can see from https://github.com/chocolatey/puppet-chocolatey/blob/master/lib/puppet/provider/package/chocolatey.rb#L19-L34 that we no longer call chocolatey.cmd.

Please upgrade to the latest version and let's see if your issue goes away.

DavidS pushed a commit to DavidS/puppetlabs-chocolatey that referenced this issue Mar 24, 2017
…cd998fb

(maint) Fix parallel spec issue with coverage_spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants