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

Notice every puppet run when ensure => latest. #36

Closed
ghost opened this issue Sep 10, 2014 · 21 comments
Closed

Notice every puppet run when ensure => latest. #36

ghost opened this issue Sep 10, 2014 · 21 comments
Milestone

Comments

@ghost
Copy link

ghost commented Sep 10, 2014

Unlike other package providers I've come across, when I select ensure => latest for a package chocolatey outputs a notice even if the package is already at the latest version.

Would it be possible to silently check for latest versions and only log a notice when a package is updated?

Thanks
Sam

@rismoney
Copy link
Contributor

whats the notice, can you paste a snip from the debug log output?

@ghost
Copy link
Author

ghost commented Sep 11, 2014

So the problem is not exactly what I thought. I couldn't reproduce it this morning after changing the packages back to ensure => present last night and was seriously confused.

I've finally worked out that this happens for packages that are ensure => latest but are not already installed on the system.

  • The provider runs chocolatey update
  • Chocolatey comes back with 'Nothing to update.'
  • This repeats every time puppet runs unless you have an ensure => present for the same package in the manifest to get it to install if no version is present on the system

This may well be deliberate behaviour on your part. But other package providers that I've used install the package if it isn't present when ensure => latest is set.

Here is some output:
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd list -lo'
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd update puppet
Notice: /Stage[main]/Windows::Apps/Package[puppet]/ensure: created
Debug: /Package[puppet]: The container Class[Windows::Apps] will propagate my refresh event
Debug: Class[Windows::Apps]: The container Stage[main] will propagate my refresh event
Debug: Finishing transaction 52896948

Thanks for your help!
Sam

@rismoney
Copy link
Contributor

just trying to clarify - you said:

I've finally worked out that this happens for packages that are ensure => latest but are not already installed on the system.

but in the output you provided the resource is changed but the puppet package is already installed (obviously you are running puppet itself)....i would expect this output only if there was a newer pkg available upstream than what you have local.

I am leaning towards a bug-
I need to test but I thought a cup would do an install of a pkg if there was nothing on the system. I could be wrong or perhaps this changed.

This could be fixed. in your case puppet has to be on the system, as how are you removing it to run puppet to orchestrate the test?

@ferventcoder
Copy link
Contributor

I need to test but I thought a cup would do an install of a pkg if there was nothing on the system. I could be wrong or perhaps this changed.

I'm not sure this is true. If you cup a package that doesn't exist, I'm not sure it does anything.

@ghost
Copy link
Author

ghost commented Sep 11, 2014

Puppet is technically installed (bad example) but not with chocolatey. So as far as chocolatey is concerned this I'm trying to update a package that isn't installed yet, and so it does nothing.

Updating puppet with chocolatey under puppet actually does seem to work fine, if I do ensure => 3.7.0.

As ferventcoder says, cup package doesn't do anything unless an older version of that package is installed.

@rismoney
Copy link
Contributor

cup used to- at least when i wrote the provider ;) i just tested on ugh! 0.9.8.20-beta2 and
--snip-- and snips in between ;)

PS C:\gitrepos\chocopackages> dir C:\chocolatey\lib
    Directory: C:\chocolatey\lib
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          9/8/2014   4:34 PM            Orca.5.0.7693
d----          9/8/2014   4:34 PM            pester.2.0.2

PS C:\gitrepos\chocopackages> cup peazip
Chocolatey (v0.9.8.20-beta2) is installing peazip and dependencies. By installing you accept the license for peazip and
each dependency you are installing.
______ peazip v5.4.1 ______
Downloading peazip 64 bit (http://www.peazip.org/downloads/peazip-5.4.1.WIN64.exe) to C:\Users\rsiegel\AppData\Local\Tem
p\chocolatey\peazip\peazipInstall.EXE.

On the latest master alpha2 I get

PS C:\gitrepos\chocopackages> cup peazip
The default install location has been changed to 'C:\ProgramData\chocolatey'.
  This install will be updated to that location in the next version. It
  is strongly suggested you move this installation to the new location
  as soon as possible to limit write access from all users. Do not forget
  to update PATH & ChocolateyInstall environment variables.
Nothing to update.

@rismoney
Copy link
Contributor

so my question to @ferventcoder, is chocolatey-update.ps1 supposed to install if a cup is requested on a non-existent package or just report nothing to update. if this is the correct behavior we can fix the provider, otherwise we can fix the chocolatey...

@rismoney
Copy link
Contributor

just to quote the yum manual-

If the packages or globs specified match to packages which are not currently installed then update will not install them

@rismoney
Copy link
Contributor

so IMHO, the fix is to be for the provider to do an install, if ensure => latest, if the package is not found

@rismoney
Copy link
Contributor

ok, I believe i have the fix here:
https://github.com/chocolatey/puppet-chocolatey/pull/37/files

@ferventcoder
The other piece to the equation is to unwind this commit as it interferes with the puppet provider output parsing:
chocolatey-archive/chocolatey@8b76d47

@ghost
Copy link
Author

ghost commented Sep 11, 2014

Thanks for all the help guys. I'm using puppet and chocolatey to push out software to new and existing laptops and desktop at work and it's been mostly painless so far!

@ferventcoder
Copy link
Contributor

Hmm. We'd need to work around that message. One can ignore messages for
parsing. I had something similar in there for the refreshing env vars
message.

On Thursday, September 11, 2014, Rich Siegel [email protected]
wrote:

ok, I believe i have the fix here:
https://github.com/chocolatey/puppet-chocolatey/pull/37/files

@ferventcoder https://github.com/ferventcoder
The other piece to the equation is to unwind this commit as it interferes
with the puppet provider output parsing:
chocolatey-archive/chocolatey@8b76d47
chocolatey-archive/chocolatey@8b76d47


Reply to this email directly or view it on GitHub
#36 (comment)
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@rismoney
Copy link
Contributor

the message is very irksome... why do i need to see it, after the 1st time.

@rismoney
Copy link
Contributor

The message should be confined to stderr, or be mentioned 1x in the installer, or just be removed... Chocolatey installer should handle the path change on its on, with no end user ramifications.

@ferventcoder
Copy link
Contributor

Chocolatey installer should handle the path change on its on, with no end user ramifications.

The problem is the path change is to a more secure location, thus cutting out non-admins from the get go. That's why the message exists. The next version will automatically handle the move, but it gives non-admins an opportunity to move the install somewhere else in the meantime.

@ferventcoder
Copy link
Contributor

Clarification: Next version being 0.9.9.

@rismoney
Copy link
Contributor

so can we remove it, hide it, move it to a different stream, or anything to make it not so ANNOYING !

@ghost
Copy link
Author

ghost commented Oct 31, 2014

Just to feed back on this. I've been running the rismoney:fix_latest branch for a while now and the fix has done the job. I've found another small problem but I'll open a separate issue for that.

@wjrogers
Copy link
Contributor

wjrogers commented Dec 9, 2014

The pull request referenced in this issue was closed without merging. ensure => latest still does not install a missing package. Should I expect this to get fixed at some point, or do I need to do both ensure => present and ensure => latest?

@rismoney
Copy link
Contributor

it's been merged. apologize for the oversight gentlemen.

@ferventcoder
Copy link
Contributor

This is fixed at least with #49.

@ferventcoder ferventcoder added this to the 0.5.0 milestone Jul 7, 2015
ferventcoder added a commit to ferventcoder/puppet-chocolatey that referenced this issue Aug 4, 2016
…91/master/restrict_tests_on_older_puppet

(MODULES-3391) Limit `rake spec` on older puppet
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

3 participants