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

ensure => latest results in resource change on every run #57

Closed
bodgit opened this issue Sep 4, 2014 · 4 comments
Closed

ensure => latest results in resource change on every run #57

bodgit opened this issue Sep 4, 2014 · 4 comments

Comments

@bodgit
Copy link

bodgit commented Sep 4, 2014

I have the following in a manifest:

rvm_gem { 'bosh_cli_plugin_micro':
    ensure       => 'latest',
    ruby_version => 'ruby-2.0',
    require      =>  Rvm_system_ruby['ruby-2.0'],
}

gem list on a host currently returns:

...
bosh_cli_plugin_micro (1.2707.0, 1.2697.0, 1.2693.0, 1.2690.0, 1.2686.0, 1.2685.0, 1.2682.0, 1.2671.0, 1.2640.0, 1.2624.0, 1.2619.0, 1.2611.0, 1.2579.0)
...

On every Puppet run, I get the following logged:

Notice: /Stage[main]/.../Rvm_gem[bosh_cli_plugin_micro]/ensure: ensure changed '1.2707.01.2697.01.2693.01.2690.01.2686.01.2685.01.2682.01.2671.01.2640.01.2624.01.2619.01.2611.01.2579.0' to 'latest'

It looks like ensure => latest doesn't correctly realise this is a no-op when the latest version (1.2707.0 presumably) is contained in the concatenated string of versions already installed.

Can anything be done to make this smarter?

@chrisleavoy
Copy link

I ran into this as well. I changed ensure => latest to ensure => present and it started working properly. Is this typical?

@holstvoogd
Copy link

@chrisleavoy there is a difference: latest installs the newest version available if it is not yet installed, present installs the latest version on the first run and then never installs a new version as long as there is any version installed.

I'm looking at creating a PR for this, my idea is to simply ensure it only reports a change if a new version was installed. Otherwise nothing is reported.

@TJM
Copy link

TJM commented Sep 8, 2015

The only time I ever hard coded my version was to get around that little GPG issue :) ... Otherwise I usually leave it as "present" as well. Setting ensure -> latest just seems like it is asking for trouble. :)

@carlossg
Copy link
Member

fixed in #115

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

5 participants