Commit 7d8a0d95 by tingweiwang

Update add_node.sh

1 parent 60f09400
Showing with 2 additions and 2 deletions
......@@ -61,8 +61,8 @@ ansible new_node -m copy -a "src=/root/k8s/config/daemon.json_gpu dest=/tmp/"
ansible new_node -m copy -a "src=/root/k8s/config/daemon.json_cpu dest=/tmp/"
################################################################################
echo "判断当前节点是gpu,还是cpu节点,根据节点不同,完成不同操作&& sleep 2"
ansible new_node -m shell -a 'if [ `lspci |grep -i vga |wc -l` -gt 1 ]; then echo "gpu节点安装docker && apt install nvidia-docker2 docker-ce --allow-unauthenticated -y"; else echo "cpu节点安装docker"&& apt install docker-ce --allow-unauthenticated -y ; fi'
ansible new_node -m shell -a 'if [ `lspci |grep -i vga |wc -l` -gt 1 ]; then echo "gpu节点分发自己节点tmp目录下的daemon.json && mv /tmp/daemon.json_gpu /etc/docker/daemon.json"; else echo "cpu节点分发自己节点tmp目录下的daemon.json"&& mv /tmp/daemon.json_cpu /etc/docker/daemon.json; fi'
ansible new_node -m shell -a 'if [ `lspci |grep -i nvidia |wc -l` -gt 1 ]; then echo "gpu节点安装docker && apt install nvidia-docker2 docker-ce --allow-unauthenticated -y"; else echo "cpu节点安装docker"&& apt install docker-ce --allow-unauthenticated -y ; fi'
ansible new_node -m shell -a 'if [ `lspci |grep -i nvidia |wc -l` -gt 1 ]; then echo "gpu节点分发自己节点tmp目录下的daemon.json && mv /tmp/daemon.json_gpu /etc/docker/daemon.json"; else echo "cpu节点分发自己节点tmp目录下的daemon.json"&& mv /tmp/daemon.json_cpu /etc/docker/daemon.json; fi'
ansible new_node -m shell -a "service docker restart"
ansible new_node -m shell -a "service docker status"
ansible new_node -m shell -a "cat /etc/docker/daemon.json"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!