Details
-
Task
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 5.5.18, PUP 6.14.0
-
-
Night's Watch
-
2
-
NW - 2020-04-15
-
Bug Fix
-
Fix idempotency of `gem` resources with composite requirements (i.e. range intersections: `>=1.3, <2.2`)
-
Needs Assessment
Description
Puppet Version: 5.5.x, master
When installing packages and using the gem provider, if you pass in the ensure a composed requirement('>x, <y') puppet will always report changes:
box# cat a.pp |
package { 'color': |
ensure => ">1, <2", |
provider => "gem" |
}
|
box# puppet apply a.pp --detailed-exitcodes |
Notice: Compiled catalog for worse-swoop.delivery.puppetlabs.net in environment production in 0.41 seconds |
Notice: /Stage[main]/Main/Package[color]/ensure: ensure changed ['1.8', '0.1.0'] to '>1, <2' |
Notice: Applied catalog in 0.66 seconds |
box# echo $? 2 |
|
box# puppet apply a.pp --detailed-exitcodes |
Notice: Compiled catalog for worse-swoop.delivery.puppetlabs.net in environment production in 0.41 seconds |
Notice: /Stage[main]/Main/Package[color]/ensure: ensure changed ['1.8', '0.1.0'] to '>1, <2' |
Notice: Applied catalog in 0.68 seconds |
box# echo $? 2 |
Seems like the Gem::Dependecy.new(https://github.com/ruby/ruby/blob/master/lib/rubygems/dependency.rb#L39) accepts a sparse argument and it can be used with an array but we are sending a string (https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/gem.rb#L130)