ansible安装
yum安装:
[root@localhost ~]# yum -y install epel-release [root@localhost ~]# yum -y install ansible
编辑/etc/ansible/hosts文件:
[root@localhost ~]# vim /etc/ansible/hosts [websevers] 192.168.0.37 192.168.0.45 192.168.0.46 192.168.0.47 192.168.0.48 192.168.0.49
ssh认证:
yum install -y sshpass ssh-keygen -f /root/.ssh/id_rsa -P '' export IP="192.168.1.61 192.168.1.62 192.168.1.63 192.168.1.64 192.168.1.65" export SSHPASS=123123 for HOST in $IP;do sshpass -e ssh-copy-id -o StrictHostKeyChecking=no $HOST done
示例:
标签:root,192.168,ansible,yum,ssh,安装,localhost From: https://www.cnblogs.com/haoee/p/16844027.html