Skip to content

Commit

Permalink
(PE-39429) Only restart puppetdb on non-legacy compilers (#511)
Browse files Browse the repository at this point in the history
* (PE-39429) Only restart puppetdb on non-legacy compilers

* (PE-39429) Simplify targets for restarting compiler services

* (maint) Fix pdk lint error

* (PE-39429) Use correct targets and only run if those targets are non-empty. This fixes errors about run_command needing 3 args when no compilers are present
  • Loading branch information
jhbuchanan45 authored Oct 17, 2024
1 parent 63fc086 commit b07439a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions plans/convert.pp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,14 @@
# Restart cluster compiler services that are likely not restarted by our
# final Puppet run to increase chance everything is functional upon plan
# completion
run_command('systemctl restart pe-puppetserver.service pe-puppetdb.service',
$all_targets - $primary_target - $primary_postgresql_target - $replica_postgresql_target)
if $legacy_compiler_targets {
run_command('systemctl restart pe-puppetserver.service', $legacy_compiler_targets)
}
# PuppetDB is only found on modern compilers, not legacy ones
if $compiler_targets {
run_command('systemctl restart pe-puppetserver.service pe-puppetdb.service', $compiler_targets)
}
# Run puppet on all targets again to ensure everything is fully up-to-date
run_task('peadm::puppet_runonce', $all_targets)
Expand Down
2 changes: 1 addition & 1 deletion types/convertsteps.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# @summary type for the different steps where the peadm::convert plan can be started
#
type Peadm::ConvertSteps = Enum[ 'modify-primary-certs', 'modify-infra-certs', 'convert-node-groups', 'finalize']
type Peadm::ConvertSteps = Enum['modify-primary-certs', 'modify-infra-certs', 'convert-node-groups', 'finalize']

0 comments on commit b07439a

Please sign in to comment.