fix: tools/easzup中kubeasz下载

dev1
gjmzj 2019-06-16 20:38:23 +08:00
parent 9f73d9392f
commit 11172c0f5b
1 changed files with 3 additions and 4 deletions

View File

@ -85,19 +85,18 @@ EOF
function get_kubeasz() { function get_kubeasz() {
# check if kubeasz already existed # check if kubeasz already existed
[[ -d "/etc/ansible/roles/kube-node" ]] && { echo "[WARN] kubeasz already existed"; return 0; } [[ -d "/etc/ansible/roles/kube-node" ]] && { echo "[WARN] kubeasz already existed"; return 0; }
# temporarily move docker binaries
[[ -f "/etc/ansible/down/docker-${DOCKER_VER}.tgz" ]] && mv "/etc/ansible/down/docker-${DOCKER_VER}.tgz" /tmp
rm -rf /etc/ansible && \
echo -e "[INFO] \033[33mdownloading kubeasz\033[0m $KUBEASZ_VER" && \ echo -e "[INFO] \033[33mdownloading kubeasz\033[0m $KUBEASZ_VER" && \
docker pull easzlab/kubeasz:${KUBEASZ_VER} && \ docker pull easzlab/kubeasz:${KUBEASZ_VER} && \
echo "[INFO] run a temporary container" && \ echo "[INFO] run a temporary container" && \
docker run -d --name temp_easz easzlab/kubeasz:${KUBEASZ_VER} && \ docker run -d --name temp_easz easzlab/kubeasz:${KUBEASZ_VER} && \
mv "/etc/ansible/down/docker-${DOCKER_VER}.tgz" /tmp && \
rm -rf /etc/ansible && \
echo "[INFO] cp kubeasz code from the temporary container" && \ echo "[INFO] cp kubeasz code from the temporary container" && \
docker cp temp_easz:/etc/ansible /etc/ansible && \ docker cp temp_easz:/etc/ansible /etc/ansible && \
echo "[INFO] stop&remove temporary container" && \ echo "[INFO] stop&remove temporary container" && \
docker rm -f temp_easz && \ docker rm -f temp_easz && \
[[ -f "/tmp/docker-${DOCKER_VER}.tgz" ]] && mv "/tmp/docker-${DOCKER_VER}.tgz" /etc/ansible/down || true mv "/tmp/docker-${DOCKER_VER}.tgz" /etc/ansible/down
} }
function get_k8s_bin() { function get_k8s_bin() {