Skip to content

Commit

Permalink
修改当context不存在时,easzctl setup默认安装在default context
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Mar 16, 2019
1 parent 4509001 commit fd22fb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/easzctl
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@ function checkout() {
}

function setup() {
[ -d "$BASEPATH/.cluster" ] || { echo "[ERROR] invalid context, run 'easzctl checkout <cluster_name>' first"; return 1; }
save_context
[ -f "$BASEPATH/bin/kube-apiserver" ] || { echo "[ERROR] no binaries found, download then fist"; return 1; }
[ -f "$BASEPATH/hosts" ] || { echo "[ERROR] no ansible hosts found, read 'docs/setup/00-planning_and_overall_intro.md'"; return 1; }
echo -e "\n[INFO] setup begin in 5s, press 'Enter' to abort\n:"
[ -d "$BASEPATH/.cluster" ] || checkout default
save_context
CLUSTER=$(cat $BASEPATH/.cluster/current_cluster)
echo -e "\n[INFO] setup cluster with context: $CLUSTER"
echo -e "[INFO] setup begin in 5s, press 'Enter' to abort\n:"
! (read -t 5 ANS) || { echo "[WARN] setup aborted"; return 1; }
ansible-playbook $BASEPATH/90.setup.yml
}
Expand Down

0 comments on commit fd22fb6

Please sign in to comment.