-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
975a468
to
58b861d
Compare
manifests/enterprise/service/nix.pp
Outdated
@@ -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], |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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']
notifiesExec['enable_splunk']
, soExec['enable_splunk']
doesn't need to requireExec['stop_splunk']
Exec['disable_splunk_boot_start']
is already subscribed toPackage[$splunk::enterprise::package_name]
, soExec['enable_splunk']
doesn't need to subscribe toPackage[$splunk::enterprise::package_name]
Exec['enable_splunk']
needs to subscribe toExec['disable_splunk_boot_start']
for proper ordering
There was a problem hiding this comment.
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 😄
a7ddcce
to
e0035aa
Compare
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.
e0035aa
to
d1eea2b
Compare
@bastelfreak Ready to merge? 🎉 |
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.