Skip to content

Commit 828f7d4

Browse files
authored
Merge pull request #228 from shawnzhu/host-key
restore host keys for cluster environment as well
2 parents 815c0ad + 0790ae1 commit 828f7d4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bin/ghe-restore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
287287
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh
288288
fi
289289

290+
# restore host keys at last step before applying config changes
291+
echo "Restoring SSH host keys ..."
292+
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-ssh-host-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/ssh-host-keys.tar" 1>&3
293+
290294
# When restoring to a host that has already been configured, kick off a
291295
# config run to perform data migrations.
292296
if $cluster; then
@@ -311,11 +315,6 @@ update_restore_status "complete"
311315
# Log restore complete message in /var/log/syslog on remote instance
312316
ghe_remote_logger "Completed restore from $(hostname) / snapshot ${GHE_RESTORE_SNAPSHOT}."
313317

314-
if ! $cluster; then
315-
echo "Restoring SSH host keys ..."
316-
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-ssh-host-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/ssh-host-keys.tar" 1>&3
317-
fi
318-
319318
echo "Completed restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT"
320319

321320
if ! $cluster; then

0 commit comments

Comments
 (0)