Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Move file_suffix default attribute logic into recipe (#272)
Browse files Browse the repository at this point in the history
---------
Co-authored-by: hc068458 <[email protected]>
  • Loading branch information
HCarr64 authored Aug 14, 2023
1 parent 8c05f86 commit 34da9fe
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
27 changes: 0 additions & 27 deletions attributes/_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,6 @@
default['splunk']['is_cloud'] = false
default['splunk']['package']['base_url'] = 'https://download.splunk.com/products'
default['splunk']['package']['platform'] = node['os']
default['splunk']['package']['file_suffix'] =
case node['platform_family']
when 'rhel', 'fedora'
if node['kernel']['machine'] == 'x86_64'
# linux rpms of splunk/UF before 9.0.5 are a differently named package.
package_version = Gem::Version.new(node['splunk']['package']['version'])
if package_version >= Gem::Version.new('9.0.5')
'.x86_64.rpm'
else
'-linux-2.6-x86_64.rpm'
end
else
'.i386.rpm'
end
when 'debian'
if node['kernel']['machine'] == 'x86_64'
'-linux-2.6-amd64.deb'
else
'-linux-2.6-intel.deb'
end
when 'windows'
if node['kernel']['machine'] == 'x86_64'
'-x64-release.msi'
else
'-x86-release.msi'
end
end

# Ignore another splunk artifact installed on a node. This is for when you want to install the universal forwarder alongisde an instance of Splunk Enterprise.
default['splunk']['ignore_already_installed_instance'] = false
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
license 'Apache-2.0'
description 'Installs/Configures Splunk Servers and Forwarders'

version '2.59.0'
version '2.60.0'

source_url 'https://github.com/cerner/cerner_splunk'
issues_url 'https://github.com/cerner/cerner_splunk/issues'
Expand Down
27 changes: 27 additions & 0 deletions recipes/_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,33 @@ def nsp

# Attributes
node.default['splunk']['package']['name'] = "#{nsp['base_name']}-#{nsp['version']}-#{nsp['build']}"
node.default['splunk']['package']['file_suffix'] =
case node['platform_family']
when 'rhel', 'fedora'
if node['kernel']['machine'] == 'x86_64'
# linux rpms of splunk/UF before 9.0.5 are a differently named package.
package_version = Gem::Version.new(node['splunk']['package']['version'])
if package_version >= Gem::Version.new('9.0.5')
'.x86_64.rpm'
else
'-linux-2.6-x86_64.rpm'
end
else
'.i386.rpm'
end
when 'debian'
if node['kernel']['machine'] == 'x86_64'
'-linux-2.6-amd64.deb'
else
'-linux-2.6-intel.deb'
end
when 'windows'
if node['kernel']['machine'] == 'x86_64'
'-x64-release.msi'
else
'-x86-release.msi'
end
end
node.default['splunk']['package']['file_name'] = "#{nsp['name']}#{nsp['file_suffix']}"
node.default['splunk']['package']['url'] =
"#{nsp['base_url']}/#{nsp['download_group']}/releases/#{nsp['version']}/#{nsp['platform']}/#{nsp['file_name']}"
Expand Down

0 comments on commit 34da9fe

Please sign in to comment.