Skip to content

Commit 4c6e497

Browse files
committed
Fix PuppetDB restore ordering, add agent run
1 parent 80e6754 commit 4c6e497

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Diff for: plans/restore.pp

+13-10
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,6 @@
198198
| CMD
199199
}
200200

201-
# Use PuppetDB's /pdb/admin/v1/archive API to MERGE previously saved data
202-
# into the restored database.
203-
# TODO: consider adding a heuristic to skip when innappropriate due to size
204-
# or other factors.
205-
if getvar('recovery_opts.puppetdb') {
206-
run_command(@("CMD"/L), $primary_target)
207-
/opt/puppetlabs/bin/puppet-db import ${shellquote($recovery_directory)}/puppetdb-archive.bin
208-
| CMD
209-
}
210-
211201
# Use `puppet infra` to ensure correct file permissions, restart services,
212202
# etc. Make sure not to try and get config data from the classifier, which
213203
# isn't yet up and running.
@@ -220,6 +210,19 @@
220210
/opt/puppetlabs/bin/puppet-infra reinitialize replica -y
221211
| CMD
222212

213+
# Use PuppetDB's /pdb/admin/v1/archive API to MERGE previously saved data
214+
# into the restored database.
215+
# TODO: consider adding a heuristic to skip when innappropriate due to size
216+
# or other factors.
217+
if getvar('recovery_opts.puppetdb') {
218+
run_command(@("CMD"/L), $primary_target)
219+
/opt/puppetlabs/bin/puppet-db import ${shellquote($recovery_directory)}/puppetdb-archive.bin
220+
| CMD
221+
}
222+
223+
# Run Puppet to pick up last remaining config tweaks
224+
run_task('peadm::puppet_runonce', $primary_target)
225+
223226
apply($primary_target){
224227
file { $recovery_directory :
225228
ensure => 'absent',

0 commit comments

Comments
 (0)