Commit 2c93de0f by tingweiwang

Update add_node.sh

1 parent a9ba7a5b
Showing with 7 additions and 7 deletions
......@@ -11,17 +11,17 @@ port=22
password=seetatech
for ip in ${new_node[@]}
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
##############根据new_node节点清单自动配置ansible hosts########
for ansible_new_node in ${new_node[@]}
do
if ! grep -qF "$ansible_new_node" /etc/hosts; then
cat >>./hosts<<EOF
$ip
EOF
else echo "您已配置该node:$ip 信息到ansible hosts文件,已跳过该步骤"
fi
if ! grep -qF "$ansible_new_node" /etc/hosts; then
cat >>./hosts<<EOF
$ip
EOF
else echo "您已配置该node:$ip 信息到ansible hosts文件,已跳过该步骤"
fi
done
########################################
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!