Skip to content

Commit 4754ddc

Browse files
authored
Merge pull request #171 from puppetlabs/update-add_compiler
Improve predictability of peadm::add_compiler
2 parents 153bd5d + 7e183ce commit 4754ddc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: plans/add_compiler.pp

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,20 @@
4949
run_task('peadm::agent_install', $compiler_target,
5050
server => $primary_target.peadm::certname(),
5151
install_flags => $dns_alt_names_flag + [
52+
'--puppet-service-ensure', 'stopped',
5253
"extension_requests:${peadm::oid('pp_auth_role')}=pe_compiler",
5354
"extension_requests:${peadm::oid('peadm_availability_group')}=${avail_group_letter}",
5455
"main:certname=${compiler_target.peadm::certname()}",
5556
],
5657
)
5758

58-
# On <compiler-host>, run the puppet agent
59-
# ignoring errors to simplify logic
60-
run_task('peadm::puppet_runonce', $compiler_target, {'_catch_errors' => true})
61-
6259
# If necessary, manually submit a CSR
6360
# ignoring errors to simplify logic
6461
run_task('peadm::submit_csr', $compiler_target, {'_catch_errors' => true})
6562

6663
# On primary, if necessary, sign the certificate request
6764
run_task('peadm::sign_csr', $primary_target, { 'certnames' => [$compiler_target.peadm::certname()] } )
6865

69-
# On <compiler-host>, run the puppet agent
70-
run_task('peadm::puppet_runonce', $compiler_target)
71-
7266
# If there was already a signed cert, force the certificate extensions we want
7367
# TODO: update peadm::util::add_cert_extensions to take care of dns alt names
7468
run_plan('peadm::util::add_cert_extensions', $compiler_target,
@@ -79,11 +73,17 @@
7973
},
8074
)
8175

76+
# On <compiler-host>, run the puppet agent
77+
run_task('peadm::puppet_runonce', $compiler_target)
78+
8279
# On <primary_postgresql_host> run the puppet agent
8380
run_task('peadm::puppet_runonce', $primary_postgresql_target)
8481

8582
# On <primary_postgresql_host> start puppet.service
86-
run_command('systemctl start puppet.service', $primary_postgresql_target)
83+
run_command('systemctl start puppet.service', peadm::flatten_compact([
84+
$primary_postgresql_target,
85+
$compiler_target,
86+
])
8787

8888
return("Adding or replacing compiler ${$compiler_target.peadm::certname()} succeeded.")
8989

0 commit comments

Comments
 (0)