shinesolutions / packer-aem

Adobe Experience Manager (AEM) machine images builder using Packer
Apache License 2.0
20 stars 20 forks source link

Inspec fails to install baking publisher and author AMIs #231

Closed fuggle07 closed 4 years ago

fuggle07 commented 4 years ago

Describe the bug When baking author and publisher AMIs, inspec fails to install due to unsatisfiable dependencies:

" aws: Error: Could not update: Execution of '/opt/puppetlabs/puppet/bin/gem install -v 1.51.18 --no-document inspec' returned 1: ERROR: Error installing inspec:  aws: parallel requires Ruby version >= 2.5."

To Reproduce Steps to reproduce the behavior:

  1. Packer command resulting in the error:

PACKER_LOG_PATH=logs/packer-aws-author.log \ PACKER_LOG=1 \ packer build \ -var-file conf/packer/vars/00_default.json -var-file conf/packer/vars/99_local.json \ -var-file=conf/packer/vars/components/author.json \ -var 'version=8' \ templates/packer/aws/generic.json

Expected behavior Expected "[0;32m aws: Notice: /Stage[main]/Config/Package[inspec]/ensure: created"

Screenshots None

Environment (please complete the following information if relevant):

Additional context This last ran successfully 20201102

mbloch1986 commented 4 years ago

Thanks @fuggle07 for reporting the issue.

The root cause seems to be a recent update of the ruby library parallel, which is a subdependency in inspec 1.51.6 (https://github.com/inspec/inspec/blob/b1801a2219722b469082c1235cc1fe528f5de07b/inspec.gemspec#L40).

The recent update of parallel included the drop of ruby 2.4(https://github.com/grosser/parallel/compare/v1.19.2...v1.20.0#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485L9), which is used as ruby version by Puppet 5.

fuggle07 commented 4 years ago

Nice one @mbloch1986.

I came to the same fix at about the same time and was about to raise a PR.

Explicitly pinning the parallel ruby gem to < 1.20 (i.e. 1.19.1 or 1.19.2) prior to attempting to install inspec 1.51.6 prevents inspec 1.51.6 pulling in parallel latest, i.e. 1.20, and breaking ruby 2.4.

mbloch1986 commented 4 years ago

Thanks @fuggle07 !

We included the fix, to lockdown the version of parallel to 1.19.2, in Packer AEM 4.27.0