deployment: retrieve SSH keys from mgmt server

As supported by ngcpcfg-api as of svn r11744.

If this works as expected then the only:

  ssh-keyscan $MANAGEMENT_IP >> ~/.ssh/known_hosts

should be needed for automatic SSH login between nodes in carrier
environment.  A working version of "ngcpcfg init_mgmt
$MANAGEMENT_IP" should be quite close then.

Let's see what's the opinion of Jenkins + our autodeploy jobs...

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 13 years ago
parent 2bcfb9156c
commit 03ac9c36bc

@ -1142,6 +1142,29 @@ EOF
esac
fi
if "$RETRIEVE_MGMT_CONFIG" ; then
password=sipwise
echo "Retrieving SSH keys from management server (using password ${password})"
wget --timeout=30 -O "${TARGET}"/root/.ssh/authorized_keys "${MANAGEMENT_IP}:3000/ssh/authorized_keys"
wget --timeout=30 -O "${TARGET}"/root/.ssh/id_rsa "${MANAGEMENT_IP}:3000/ssh/id_rsa?password=${password}"
wget --timeout=30 -O "${TARGET}"/root/.ssh/id_rsa.pub "${MANAGEMENT_IP}:3000/ssh/id_rsa_pub"
chmod 600 "${TARGET}"/root/.ssh/authorized_keys
chmod 600 "${TARGET}"/root/.ssh/id_rsa
chmod 644 "${TARGET}"/root/.ssh/id_rsa.pub
wget --timeout=30 -O "${TARGET}"/etc/ssh/ssh_host_dsa_key "${MANAGEMENT_IP}:3000/ssh/host_dsa_key?password=${password}"
wget --timeout=30 -O "${TARGET}"/etc/ssh/ssh_host_dsa_key.pub "${MANAGEMENT_IP}:3000/ssh/host_dsa_key_pub"
wget --timeout=30 -O "${TARGET}"/etc/ssh/ssh_host_rsa_key "${MANAGEMENT_IP}:3000/ssh/host_rsa_key?password=${password}"
wget --timeout=30 -O "${TARGET}"/etc/ssh/ssh_host_rsa_key.pub "${MANAGEMENT_IP}:3000/ssh/host_rsa_key_pub"
chmod 600 "${TARGET}"/etc/ssh/ssh_host_dsa_key
chmod 644 "${TARGET}"/etc/ssh/ssh_host_dsa_key.pub
chmod 600 "${TARGET}"/etc/ssh/ssh_host_rsa_key
chmod 644 "${TARGET}"/etc/ssh/ssh_host_rsa_key.pub
fi
# make sure all services are stopped
for service in \
apache2 \

Loading…
Cancel
Save