Skip to content

Commit

Permalink
Update (or remove in favor of Test Kitchen) ChefSpec examples
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Apr 11, 2019
1 parent e7d58f9 commit b49d896
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 78 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@

# yum
default['rabbitmq']['erlang']['yum']['baseurl'] = value_for_platform(
['centos', 'rhel', 'scientific'] => {
%w(centos rhel redhat scientific) => {
'< 7.0' => 'https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6',
'default' => 'https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/7'
},
Expand Down
26 changes: 18 additions & 8 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Chef::Recipe
default_deb_package_name = "rabbitmq-server_#{version}-1_all.deb"

default_rpm_package_name = value_for_platform(
['centos', 'rhel', 'scientific'] => {
%w(centos rhel redhat scientific) => {
'< 7.0' => "rabbitmq-server-#{version}-1.el6.noarch.rpm",
'default' => "rabbitmq-server-#{version}-1.el7.noarch.rpm"
},
Expand Down Expand Up @@ -77,8 +77,7 @@ class Chef::Recipe
end

## Install the package
case node['platform_family']
when 'debian'
if platform_family?('debian', 'ubuntu')
template '/etc/apt/apt.conf.d/90forceyes' do
source '90forceyes.erb'
owner 'root'
Expand Down Expand Up @@ -154,8 +153,9 @@ class Chef::Recipe
variables(:max_file_descriptors => node['rabbitmq']['max_file_descriptors'])
end
end
end

when 'fedora'
if platform_family?('fedora')
package 'logrotate'
package 'socat'

Expand All @@ -180,7 +180,9 @@ class Chef::Recipe
end
rpm_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
end
when 'rhel', 'centos', 'scientific'
end

if platform_family?('rhel', 'redhat', 'centos', 'scientific') # ~FC024
package 'logrotate'
if node['platform_version'].to_i >= 7
package 'socat'
Expand Down Expand Up @@ -215,7 +217,9 @@ class Chef::Recipe
end
rpm_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
end
when 'amazon'
end

if platform_family?('amazon')
package 'logrotate'
package 'socat'

Expand All @@ -241,8 +245,9 @@ class Chef::Recipe
end
yum_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
end
when 'suse'
end

if platform_family?('suse')
package 'logrotate'
package 'socat'

Expand All @@ -257,8 +262,9 @@ class Chef::Recipe
action :install
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
end
end

when 'smartos'
if platform_family?('smartos')
package 'rabbitmq' do
action :install
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
Expand All @@ -270,6 +276,10 @@ class Chef::Recipe

end

#
# Users and directories
#

if platform_family?('amazon')
user 'rabbitmq' do
username node['rabbitmq']['user']
Expand Down
Loading

0 comments on commit b49d896

Please sign in to comment.