puppetlabs / puppetlabs-apt

Puppet module to help manage Apt
https://forge.puppetlabs.com/puppetlabs/apt
Apache License 2.0
216 stars 463 forks source link

upgrade to 9.1.0 make /apt_key.rb:100: syntax error, unexpected ']' #1144

Open aqueos opened 8 months ago

aqueos commented 8 months ago

Describe the Bug

since upgrading to 9.1.0 puppet fail to run with

Error: Could not autoload puppet/provider/apt_key/apt_key: /opt/puppetlabs/puppet/cache/lib/puppet/provider/apt_key/apt_key.rb:100: syntax error, unexpected ']'
...   key_long: fingerprint[-16..], # last 16 characters of fin...

downgrading to 9.0.2 and all works again. puppet module install puppetlabs-apt --ignore-dependencies --version 9.0.2 --force

Expected Behavior

continue working like with 9.0.2

Steps to Reproduce

Steps to reproduce the behavior:

  1. upgrade the module version 2 run puppet agent

Environment

Additional Context


Notice: Found 'puppetlabs-apt' (v9.0.2) in /etc/puppetlabs/code/environments/production/modules ...                                                                                                                                                           
Notice: Downloading from https://forgeapi.puppet.com ...                                                                                                                                                                                                      
Notice: Upgrading -- do not interrupt ...                                                                                                                                                                                                                     
/etc/puppetlabs/code/environments/production/modules                                                                                                                                                                                                          
└── puppetlabs-apt (v9.0.2 -> v9.1.0)  
[~]: puppetreload 
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not autoload puppet/provider/apt_key/apt_key: /opt/puppetlabs/puppet/cache/lib/puppet/provider/apt_key/apt_key.rb:100: syntax error, unexpected ']'
...   key_long: fingerprint[-16..], # last 16 characters of fin...
kenyon commented 8 months ago

This is due to the Ruby version being too old. This version of the module doesn't support Puppet 6 anymore. Same as https://github.com/puppetlabs/puppetlabs-vcsrepo/issues/624.

aqueos commented 3 months ago

Thanks for your answer.

I wonder why puppet module upgrade it then, is there not a mean to specify which version of puppet the module suport ?

best regards, Ghislain.

kenyon commented 3 months ago

Supported Puppet versions are listed in the metadata, but it is not enforced: https://github.com/puppetlabs/puppetlabs-apt/blob/22ed8ab5509d7f0f553f3dd4fab3c096c17214b0/metadata.json#L33-L38

aqueos commented 3 months ago

oh ok, so it is a bug/missing feature of puppet core then, thanks a lot !

best regards, Ghislain.