easzup: 预处理安装前准备ssh key pair/python

pull/641/head
gjmzj 2019-06-30 19:39:06 +08:00
parent a3db781926
commit a6a97584b1
1 changed files with 15 additions and 1 deletions

View File

@ -208,6 +208,20 @@ function start_kubeasz_docker() {
host_ip=$(ip a|grep "$host_if$"|awk '{print $2}'|cut -d'/' -f1)
echo "[INFO] get host IP: $host_ip"
# allow ssh login using key locally
if [[ ! -e /root/.ssh/id_rsa ]]; then
echo "[INFO] generate ssh key pair"
ssh-keygen -t rsa -b 2048 -N '' -f /root/.ssh/id_rsa > /dev/null
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
ssh-keyscan -t ecdsa -H "$host_ip" >> /root/.ssh/known_hosts
fi
# create a link '/usr/bin/python' in Ubuntu1604
if [[ ! -e /usr/bin/python && -e /etc/debian_version ]]; then
echo "[INFO] create a soft link '/usr/bin/python'"
ln -s /usr/bin/python3 /usr/bin/python
fi
#
docker load -i /etc/ansible/down/kubeasz_${KUBEASZ_VER}.tar