From 739d0d9b74a713502e52761ef08d4d431fff7f12 Mon Sep 17 00:00:00 2001 From: Mark Egan-Fuller Date: Wed, 28 May 2025 14:20:23 +0100 Subject: [PATCH] Move puppet agent start after first run. Otherwise we can fail the first run because a run has already started. --- plans/extend_ca_cert.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plans/extend_ca_cert.pp b/plans/extend_ca_cert.pp index 002c9f9..0139cd8 100644 --- a/plans/extend_ca_cert.pp +++ b/plans/extend_ca_cert.pp @@ -84,13 +84,13 @@ run_command("/bin/cp ${new_cert['new_cert']} ${ssldir}/ca/ca_crt.pem", $targets) run_task('service::linux', $targets, 'action' => 'start', 'name' => 'puppetserver') } - run_task('service::linux', $targets, 'action' => 'start', 'name' => 'puppet') $tmp = run_command('mktemp', 'localhost', '_run_as' => system::env('USER')) $tmp_file = $tmp.first.value['stdout'].chomp file::write($tmp_file, $cert_contents) run_command('/opt/puppetlabs/bin/puppet agent --no-daemonize --no-noop --onetime', $targets) + run_task('service::linux', $targets, 'action' => 'start', 'name' => 'puppet') if $is_pe and $replica { out::message("INFO: Stopping Puppet services on ${replica}")