Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrading Splunk Enterprise #363

Merged
merged 1 commit into from Mar 23, 2024

Conversation

siegy22
Copy link
Contributor

@siegy22 siegy22 commented Mar 22, 2024

When upgrading, there was an issue with accepting the license of the new version. Thus symptoms described in #339 happened. To ensure we have a clean upgrade we need to re-enable boot-start after the upgrade.

This will also apply the correct systemd service file when upgrading, before it was just the service file of the originally installed version. It never changed.

@siegy22 siegy22 force-pushed the enterprise-upgrade branch 2 times, most recently from 975a468 to 58b861d Compare March 22, 2024 23:55
@@ -28,7 +34,8 @@
command => "${splunk::enterprise::enterprise_homedir}/bin/splunk enable boot-start ${user_args} ${splunk::params::boot_start_args} --accept-license --answer-yes --no-prompt",
refreshonly => true,
before => Service[$splunk::enterprise::service_name],
require => Exec['stop_splunk'],
require => [Exec['stop_splunk'], Exec['disable_splunk_boot_start']],
subscribe => Package[$splunk::enterprise::package_name],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the subscribe isn't required because the new exec already subscribes to the same package resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it is needed, I just tested this using this snippet:

file { '/tmp/foo':
  content => "foo",
}

exec { 'bar':
  command => "/usr/bin/echo bar",
  refreshonly => true,
  subscribe => File['/tmp/foo'],
}

exec { 'baz':
  command => "/usr/bin/echo baz",
  refreshonly => true,
  require => Exec['bar']
}

In this scenario, baz was never executed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right. Because require only enforces the ordering, but it doesn't do any refresh.

exec { 'enable_splunk':
    command     => "${splunk::enterprise::enterprise_homedir}/bin/splunk enable boot-start ${user_args} ${splunk::params::boot_start_args} --accept-license --answer-yes --no-prompt",
    refreshonly => true,
    before      => Service[$splunk::enterprise::service_name],
    subscribe   => Exec['disable_splunk_boot_start']
}

This is probably enough?

  • Exec['stop_splunk'] notifies Exec['enable_splunk'], so Exec['enable_splunk'] doesn't need to require Exec['stop_splunk']
  • Exec['disable_splunk_boot_start'] is already subscribed to Package[$splunk::enterprise::package_name], so Exec['enable_splunk'] doesn't need to subscribe to Package[$splunk::enterprise::package_name]
  • Exec['enable_splunk'] needs to subscribe to Exec['disable_splunk_boot_start'] for proper ordering

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it kind of does the same, before it was done by subscribing to the Package, and then setting the order by adding it to the require parameter.
But I changed it to the way you proposed it 😄

@siegy22 siegy22 force-pushed the enterprise-upgrade branch 3 times, most recently from a7ddcce to e0035aa Compare March 23, 2024 13:00
When upgrading, there was an issue with accepting the license of the new version.
Thus symptoms like described in voxpupuli#339 happened. To ensure we have a clean upgrade
we need to re-enable boot-start after the upgrade.

This will also apply the correct systemd service file when upgrading, before it
was just the service file of the originally installed version. It never changed.
@siegy22
Copy link
Contributor Author

siegy22 commented Mar 23, 2024

@bastelfreak Ready to merge? 🎉

@bastelfreak bastelfreak merged commit 00a989d into voxpupuli:master Mar 23, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants