Skip to content

Commit b49d896

Browse files
Update (or remove in favor of Test Kitchen) ChefSpec examples
1 parent e7d58f9 commit b49d896

File tree

4 files changed

+73
-78
lines changed

4 files changed

+73
-78
lines changed

attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253

254254
# yum
255255
default['rabbitmq']['erlang']['yum']['baseurl'] = value_for_platform(
256-
['centos', 'rhel', 'scientific'] => {
256+
%w(centos rhel redhat scientific) => {
257257
'< 7.0' => 'https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6',
258258
'default' => 'https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/7'
259259
},

recipes/default.rb

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Chef::Recipe
4646
default_deb_package_name = "rabbitmq-server_#{version}-1_all.deb"
4747

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

7979
## Install the package
80-
case node['platform_family']
81-
when 'debian'
80+
if platform_family?('debian', 'ubuntu')
8281
template '/etc/apt/apt.conf.d/90forceyes' do
8382
source '90forceyes.erb'
8483
owner 'root'
@@ -154,8 +153,9 @@ class Chef::Recipe
154153
variables(:max_file_descriptors => node['rabbitmq']['max_file_descriptors'])
155154
end
156155
end
156+
end
157157

158-
when 'fedora'
158+
if platform_family?('fedora')
159159
package 'logrotate'
160160
package 'socat'
161161

@@ -180,7 +180,9 @@ class Chef::Recipe
180180
end
181181
rpm_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
182182
end
183-
when 'rhel', 'centos', 'scientific'
183+
end
184+
185+
if platform_family?('rhel', 'redhat', 'centos', 'scientific') # ~FC024
184186
package 'logrotate'
185187
if node['platform_version'].to_i >= 7
186188
package 'socat'
@@ -215,7 +217,9 @@ class Chef::Recipe
215217
end
216218
rpm_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
217219
end
218-
when 'amazon'
220+
end
221+
222+
if platform_family?('amazon')
219223
package 'logrotate'
220224
package 'socat'
221225

@@ -241,8 +245,9 @@ class Chef::Recipe
241245
end
242246
yum_package "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}"
243247
end
244-
when 'suse'
248+
end
245249

250+
if platform_family?('suse')
246251
package 'logrotate'
247252
package 'socat'
248253

@@ -257,8 +262,9 @@ class Chef::Recipe
257262
action :install
258263
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
259264
end
265+
end
260266

261-
when 'smartos'
267+
if platform_family?('smartos')
262268
package 'rabbitmq' do
263269
action :install
264270
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
@@ -270,6 +276,10 @@ class Chef::Recipe
270276

271277
end
272278

279+
#
280+
# Users and directories
281+
#
282+
273283
if platform_family?('amazon')
274284
user 'rabbitmq' do
275285
username node['rabbitmq']['user']

0 commit comments

Comments
 (0)