Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为 easzctl 增加 ${@:3} 队列变量, 以支持在 hosts 为 node 增加更多主机变量 #749

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/easzctl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function add-node() {
sed -n '/^\[kube-master/,/^\[harbor/p' $BASEPATH/hosts|grep "^$1[^0-9]*$" && { echo "[ERROR] node $1 already existed!"; return 2; }

# add a node into 'kube-node' group
sed -i "/\[kube-node/a $1 NEW_NODE=yes" $BASEPATH/hosts
sed -i "/\[kube-node/a $1 NEW_NODE=yes ${@:2}" $BASEPATH/hosts

# check if playbook runs successfully
ansible-playbook $BASEPATH/tools/02.addnode.yml -e NODE_TO_ADD=$1 || { sed -i "/$1 NEW_NODE=yes/d" $BASEPATH/hosts; return 2; }
Expand All @@ -97,7 +97,7 @@ function add-master() {
sed -n '/^\[kube-master/,/^\[kube-node/p' $BASEPATH/hosts|grep "^$1[^0-9]*$" && { echo "[ERROR] master $1 already existed!"; return 2; }

# add a node into 'kube-master' group
sed -i "/\[kube-master/a $1 NEW_MASTER=yes" $BASEPATH/hosts
sed -i "/\[kube-master/a $1 NEW_MASTER=yes ${@:2}" $BASEPATH/hosts

# check if playbook runs successfully
ansible-playbook $BASEPATH/tools/03.addmaster.yml -e NODE_TO_ADD=$1 || { sed -i "/$1 NEW_MASTER=yes/d" $BASEPATH/hosts; return 2; }
Expand Down Expand Up @@ -419,12 +419,12 @@ case "$1" in
(add-master)
[ "$#" -gt 1 ] || { usage >&2; exit 2; }
ACTION="Action: add a k8s master node"
CMD="add-master $2"
CMD="add-master $2 ${@:3}"
;;
(add-node)
[ "$#" -gt 1 ] || { usage >&2; exit 2; }
ACTION="Action: add a k8s work node"
CMD="add-node $2"
CMD="add-node $2 ${@:3}"
;;
(del-etcd)
[ "$#" -gt 1 ] || { usage >&2; exit 2; }
Expand Down