Commit a09e0b5a by tingweiwang

scp 密钥时通过for 循环实现新添加的多node节点拷贝

1 parent 896e5757
Showing with 4 additions and 1 deletions
......@@ -28,7 +28,10 @@ cat /etc/ansible/hosts && sleep 6
########################执行初始化脚本以及配置##########################################
ansible new_node -m script -a "/root/k8s/script/k8s/backup/1-init.sh"
ansible new_node -m shell -a "mkdir /opt/kubernetes/{cfg,bin,ssl,log} -pv"
scp /opt/kubernetes/ssl/ca* $new_node:/opt/kubernetes/ssl/
for ip2 in ${new_node[@]}
do
scp /opt/kubernetes/ssl/ca* $ip2:/opt/kubernetes/ssl/
done
#########################################flannel########################################
ansible new_node -m copy -a "src=/opt/kubernetes/bin/mk-docker-opts.sh dest=/opt/kubernetes/bin/ mode=755"
ansible new_node -m copy -a "src=/opt/kubernetes/bin/flanneld dest=/opt/kubernetes/bin/ mode=755"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!