Skip to content

Commit aa6c3e9

Browse files
committed
COOK-123 Add amazon to rhel platform_family conditional
1 parent d25a80f commit aa6c3e9

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.foodcritic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
~FC024
12
~FC053
23
~FC064
34
~FC065

recipes/_compression_libs.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Cookbook Name:: hadoop
33
# Recipe:: _compression_libs
44
#
5-
# Copyright © 2013-2016 Cask Data, Inc.
5+
# Copyright © 2013-2017 Cask Data, Inc.
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
case node['platform_family']
2626
when 'debian'
2727
pkgs += ['libsnappy1', 'libsnappy-dev']
28-
when 'rhel'
28+
when 'rhel', 'amazon'
2929
pkgs += ['snappy', 'snappy-devel']
3030
end
3131

@@ -34,7 +34,7 @@
3434
case node['platform_family']
3535
when 'debian'
3636
pkgs += ['liblzo2-2', 'liblzo2-dev', 'hadooplzo']
37-
when 'rhel'
37+
when 'rhel', 'amazon'
3838
pkgs += ['lzo', 'lzo-devel', 'hadooplzo', 'hadooplzo-native']
3939
end
4040
elsif iop?

recipes/_sql_connectors.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Cookbook Name:: hadoop
33
# Recipe:: _sql_connectors
44
#
5-
# Copyright © 2015 Cask Data, Inc.
5+
# Copyright © 2015-2017 Cask Data, Inc.
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
3737
jars = pkgs
3838
end
3939
when 'postgresql'
40-
if node['platform_family'] == 'rhel'
40+
if platform_family?('rhel', 'amazon')
4141
if node['platform_version'].to_i == '5'
4242
Chef::Log.warn('You must download and install JDBC connectors, manually')
4343
pkgs = nil

recipes/default.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Cookbook Name:: hadoop
33
# Recipe:: default
44
#
5-
# Copyright © 2013-2015 Cask Data, Inc.
5+
# Copyright © 2013-2017 Cask Data, Inc.
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -121,7 +121,7 @@
121121
svc
122122
end
123123
default_log_dir =
124-
if hdp22? && node['platform_family'] == 'rhel'
124+
if hdp22? && platform_family?('amazon', 'rhel')
125125
"/var/log/hadoop/#{log_dir}"
126126
else
127127
"/var/log/hadoop-#{log_dir}"
@@ -148,7 +148,7 @@
148148
# symlink HDP 2.2 log directory
149149
link "/var/log/hadoop/#{log_dir}" do
150150
to node['hadoop'][envfile]["#{svc}_log_dir"]
151-
only_if { hdp22? && node['platform_family'] == 'rhel' }
151+
only_if { hdp22? && platform_family?('amazon', 'rhel') }
152152
end
153153
end
154154
# rubocop:enable Style/Next

recipes/repo.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
hdp_utils_version = '1.1.0.20'
8282

8383
case node['platform_family']
84-
when 'rhel'
84+
when 'rhel', 'amazon'
8585
yum_base_url = 'http://public-repo-1.hortonworks.com/HDP'
8686
os = if major_platform_version == 5 || hdp_version.to_f >= 2.3
8787
"centos#{major_platform_version}"
@@ -180,7 +180,7 @@
180180
end
181181
Chef::Log.warn("Short versions for node['hadoop']['distribution_version'] are deprecated! Please use full version!") if node['hadoop']['distribution_version'].to_s == '5'
182182
case node['platform_family']
183-
when 'rhel'
183+
when 'rhel', 'amazon'
184184
yum_base_url = "http://archive.cloudera.com/cdh#{cdh_release}/redhat"
185185
yum_repo_url = node['hadoop']['yum_repo_url'] ? node['hadoop']['yum_repo_url'] : "#{yum_base_url}/#{major_platform_version}/#{node['kernel']['machine']}/cdh/#{node['hadoop']['distribution_version']}"
186186
yum_repo_key_url = node['hadoop']['yum_repo_key_url'] ? node['hadoop']['yum_repo_key_url'] : "#{yum_base_url}/#{major_platform_version}/#{node['kernel']['machine']}/cdh/#{key}-cloudera"
@@ -243,7 +243,7 @@
243243
Chef::Log.warn('Allowing install of unsigned binaries') unless validate_repo_key
244244

245245
case node['platform_family']
246-
when 'rhel'
246+
when 'rhel', 'amazon'
247247

248248
case major_platform_version
249249
when 5, 6
@@ -308,7 +308,7 @@
308308
iop_utils_version = '1.2.0.0'
309309

310310
case node['platform_family']
311-
when 'rhel'
311+
when 'rhel', 'amazon'
312312
# https://ibm-open-platform.ibm.com/repos/IOP/rhel/6/x86_64/4.1.x/GA/4.1.0.0/
313313
yum_base_url = 'https://ibm-open-platform.ibm.com/repos/IOP'
314314
os = 'rhel'

0 commit comments

Comments
 (0)