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

version is hard coded so that we can't change the default version in wrap cookbooks #457

Wing924 opened this issue Aug 30, 2017 · 1 comment


None yet
2 participants
Copy link

commented Aug 30, 2017

Those codes are evaluated before wrap cookbooks, so we can't change those attributes by overwrite node['rabbitmq']['version'].

default['rabbitmq']['deb_package'] = "rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb"
default['rabbitmq']['deb_package_url'] = "{node['rabbitmq']['version']}/"

case node['platform_family']
when 'rhel', 'fedora'
  default['rabbitmq']['rpm_package'] = if node['platform_version'].to_i > 6
when 'suse'
  default['rabbitmq']['rpm_package'] = "rabbitmq-server-#{node['rabbitmq']['version']}-1.suse.noarch.rpm"

default['rabbitmq']['rpm_package_url'] = "{node['rabbitmq']['version']}/"


Per suggestion from @yardinicwaller:

Do URL string interpolation in a recipe, while still allowing that to be overridden by an attribute if defined. It would look something like this:


default['rabbitmq']['version'] = '3.6.12'
default['rabbitmq']['deb_package'] = nil # override me if you have a local mirror


default_deb_package = "https://[base URL]/v#{node['rabbitmq']['version']}/"
deb_package = node['rabbitmq']['deb_package'] || default_deb_package
remote_file "#{Chef::Config[:file_cache_path]}/#{deb_package}" do
  source deb_package

This comment has been minimized.

Copy link

commented Aug 30, 2017

@Wing924 feel free to look into a pull request that would make the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.