Commit 2c93de0f by tingweiwang

Update add_node.sh

1 parent a9ba7a5b
Showing with 7 additions and 7 deletions
...@@ -11,17 +11,17 @@ port=22 ...@@ -11,17 +11,17 @@ port=22
password=seetatech password=seetatech
for ip in ${new_node[@]} for ip in ${new_node[@]}
do do
sshpass -p $password ssh-copy-id -i ~/.ssh/id_rsa.pub -p $port -o StrictHostKeyChecking=no root@$ip sshpass -p $password ssh-copy-id -i ~/.ssh/id_rsa.pub -p $port -o StrictHostKeyChecking=no root@$ip
done done
##############根据new_node节点清单自动配置ansible hosts######## ##############根据new_node节点清单自动配置ansible hosts########
for ansible_new_node in ${new_node[@]} for ansible_new_node in ${new_node[@]}
do do
if ! grep -qF "$ansible_new_node" /etc/hosts; then if ! grep -qF "$ansible_new_node" /etc/hosts; then
cat >>./hosts<<EOF cat >>./hosts<<EOF
$ip $ip
EOF EOF
else echo "您已配置该node:$ip 信息到ansible hosts文件,已跳过该步骤" else echo "您已配置该node:$ip 信息到ansible hosts文件,已跳过该步骤"
fi fi
done done
######################################## ########################################
ansible new_node -m script -a "/root/k8s/script/k8s/backup/1-init.sh" ansible new_node -m script -a "/root/k8s/script/k8s/backup/1-init.sh"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!