Long-term, /tmp/mcp.rsa should be moved to a persistent location [1],
and made configurable via env var / other mechanisms.
This will allow us to:
- use an existing keypair (provided by end-user in expected path);
- login to previous deployment machines (e.g. to cleanup UEFI boot
entries before destroying the cluster and rebuilding it);
- split deploy in re-entrant stages (salt master only, cluster nodes
only; similar to old Fuel, where we could reuse old Fuel VM);
[1] https://jira.opnfv.org/browse/FUEL-280
Change-Id: I1e53321ed1cfc217ff95e809c867fa3370c479c9
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
user=${SUDO_USER}
fi
+ if [ -f "/tmp/${SSH_KEY}" ]; then
+ cp "/tmp/${SSH_KEY}" .
+ ssh-keygen -f "${SSH_KEY}" -y > "${SSH_KEY}.pub"
+ fi
+
[ -f "${SSH_KEY}" ] || ssh-keygen -f "${SSH_KEY}" -N ''
install -o "${user}" -m 0600 "${SSH_KEY}" /tmp/
}