From 586a80be6cdc8c397bbbabc03018080e1ced836a Mon Sep 17 00:00:00 2001 From: Jacob Buchanan Date: Mon, 14 Oct 2024 16:29:22 +0100 Subject: [PATCH] (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 --- plans/convert.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plans/convert.pp b/plans/convert.pp index 15681676..1ff1771a 100644 --- a/plans/convert.pp +++ b/plans/convert.pp @@ -305,10 +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', $legacy_compiler_targets) + if $legacy_compiler_targets { + run_command('systemctl restart pe-puppetserver.service', $legacy_compiler_targets) + } # PuppetDB is only found on modern compilers, not legacy ones - run_command('systemctl restart pe-puppetdb.service pe-puppetserver.service', $compiler_hosts) + 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)