“Ansible基础”的版本间的差异
跳到导航
跳到搜索
(→ins) |
(→ins) |
||
第16行: | 第16行: | ||
192.168.88.51 | 192.168.88.51 | ||
192.168.88.52 | 192.168.88.52 | ||
+ | |||
+ | [intra] | ||
+ | 192.168.10.120 | ||
+ | 192.168.10.121 | ||
ansible all -b -u root -a "hostname" | ansible all -b -u root -a "hostname" |
2021年9月23日 (四) 06:56的版本
ins
#on master pip3 install --user ansible ssh-copy-id -i id_ecdsa.pub [email protected] ssh-copy-id -i id_ecdsa.pub [email protected] ssh-copy-id -i id_ecdsa.pub [email protected] mkdir /etc/ansible vi /etc/ansible/hosts 192.168.88.50 192.168.88.51 192.168.88.52 [intra] 192.168.10.120 192.168.10.121 ansible all -b -u root -a "hostname" 192.168.88.51 | CHANGED | rc=0 >> k8s-node1 192.168.88.50 | CHANGED | rc=0 >> k8s-master 192.168.88.52 | CHANGED | rc=0 >> k8s-node2 ansible all -m ping
分发文件
cat /etc/ansible/hosts [intra] 192.168.10.120 192.168.10.121 ansible intra -m copy -a "src=/home/evan/data/devops/node-v14.17.6-linux-x64.tar.xz dest=/root/"