criteo-cookbooks / nexus3

Chef cookbook to install and configure Sonatype Nexus 3 Repository Manager
http://www.sonatype.com/download-oss-sonatype
MIT License
17 stars 17 forks source link

Overriding version doesn't install correct version #100

Closed pvandervelde closed 4 years ago

pvandervelde commented 5 years ago

Overriding the version by setting default['nexus3']['version'] in the cookbook doesn't install the correct version. It installs the version that is defaulted in the nexus3 cookbook. If you override both the version and the download URL then it will download and install the correct version.

To test:

  nexus3 'nexus' do
    action :install
  end

After the install all folders etc. point to 3.18.1 but the install is actually for version 3.16.2-01 (which is the default version in the nexus3 cookbook)

I suspect this behaviour is due to the fact that the version is used in the download URL. I guess that version is read as soon as the default download URL is constructed which seems to be before the version number is overwritten by the dependent cookbook

Annih commented 4 years ago

Hello @pvandervelde, First thank you for your feedback, and sorry for the late answer.

About your issue, this is a known behavior due to your usage of a wrapper cookbook and the way Chef computes attributes. A quick fix I can suggest you is to override both version and url. Otherwise you can wait a bit that we merge #96 and release a new version of this cookbook.