Skip to content

Commit

Permalink
[COOK-4431] - RPM / DEB package installs now use the rabbit version y…
Browse files Browse the repository at this point in the history
…ou specify

Signed-off-by: Sean OMeara <someara@opscode.com>
  • Loading branch information
Matthew Rathbone authored and Sean OMeara committed Mar 19, 2014
1 parent e29a1b9 commit 65ad07e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 0 additions & 4 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@

# platform specific settings
case node['platform_family']
when 'debian'
default['rabbitmq']['package'] = "https://www.rabbitmq.com/releases/rabbitmq-server/v#{node['rabbitmq']['version']}/rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb"
when 'rhel', 'fedora'
default['rabbitmq']['package'] = "https://www.rabbitmq.com/releases/rabbitmq-server/v#{node['rabbitmq']['version']}/rabbitmq-server-#{node['rabbitmq']['version']}-1.noarch.rpm"
when 'smartos'
default['rabbitmq']['service_name'] = 'rabbitmq'
default['rabbitmq']['config_root'] = '/opt/local/etc/rabbitmq'
Expand Down
9 changes: 7 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ class Chef::Resource
if node['rabbitmq']['use_distro_version']
package 'rabbitmq-server'
else
# we need to download the package
deb_package = "https://www.rabbitmq.com/releases/rabbitmq-server/v#{node['rabbitmq']['version']}/rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb"
remote_file "#{Chef::Config[:file_cache_path]}/rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb" do
source node['rabbitmq']['package']
source deb_package
action :create_if_missing
end
dpkg_package "#{Chef::Config[:file_cache_path]}/rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb"
Expand Down Expand Up @@ -101,8 +103,11 @@ class Chef::Resource
if node['rabbitmq']['use_distro_version']
package 'rabbitmq-server'
else
# We need to download the rpm
rpm_package = "https://www.rabbitmq.com/releases/rabbitmq-server/v#{node['rabbitmq']['version']}/rabbitmq-server-#{node['rabbitmq']['version']}-1.noarch.rpm"

remote_file "#{Chef::Config[:file_cache_path]}/rabbitmq-server-#{node['rabbitmq']['version']}-1.noarch.rpm" do
source node['rabbitmq']['package']
source rpm_package
action :create_if_missing
end
rpm_package "#{Chef::Config[:file_cache_path]}/rabbitmq-server-#{node['rabbitmq']['version']}-1.noarch.rpm"
Expand Down

1 comment on commit 65ad07e

@poliva83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this change breaks the ability to "You may override the download URL attribute ['rabbitmq']['package'] if you wish to use a local mirror." as it states in cookbook description.

Please sign in to comment.