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

Commit

Permalink
Stop Splunk before package upgrades (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
gravesb authored Dec 15, 2022
1 parent ddb4b29 commit e97e9d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.56.0'
version '2.56.1'

source_url 'https://github.com/cerner/cerner_splunk'
issues_url 'https://github.com/cerner/cerner_splunk/issues'
Expand Down
10 changes: 10 additions & 0 deletions recipes/_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ def nsp
only_if(&manifest_missing)
end

# If this is an upgrade, we should stop splunk before installing the new package
# The vagrant tests timeout trying to stop splunk on the windows box though, so skip windows
# https://docs.splunk.com/Documentation/Forwarder/9.0.2/Forwarder/Upgradetheuniversalforwarder
# https://docs.splunk.com/Documentation/Splunk/9.0.2/Installation/UpgradeonUNIX#Upgrade_Splunk_Enterprise
ruby_block 'upgrade-splunk-stop' do
block { true }
notifies :stop, 'service[splunk]', :immediately
only_if { CernerSplunk.splunk_installed?(node) && node['splunk']['package']['version'] != previous_splunk_version && !platform_family?('windows') }
end

if platform_family? 'rhel', 'fedora', 'amazon'
rpm_package node['splunk']['package']['base_name'] do
source splunk_file
Expand Down

0 comments on commit e97e9d2

Please sign in to comment.