diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 94f41cb..aad066f 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1452,6 +1452,18 @@ EOT fi fi +if [[ -n "${MANAGEMENT_IP}" ]] && "${RETRIEVE_MGMT_CONFIG}" ; then + echo "Retrieving public key from management node" + cat > "${TARGET}/tmp/retrieve_authorized_keys.sh" << EOT +#!/bin/bash +set -e +mkdir -p /root/.ssh +wget --timeout=30 -O /root/.ssh/authorized_keys "http://${MANAGEMENT_IP}:3000/ssh/id_rsa_pub" +chmod 600 /root/.ssh/authorized_keys +EOT + grml-chroot "${TARGET}" /bin/bash /tmp/retrieve_authorized_keys.sh +fi + case "$DEBIAN_RELEASE" in stretch) set_custom_grub_boot_options