1、准备三台虚拟机
master 192.168.1.211
slave 192.168.1.210
slave 192.168.1.195
2、安装ansible
Ansible仓库默认不在yum仓库中,因此我们需要启用epel仓库
安装epel
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
安装python-jinja2-2.7.2-4.el7
网址为https://centos.pkgs.org/7/centos-x86_64/python-jinja2-2.7.2-4.el7.noarch.rpm.html
然后使用rz上传
[root@localhost ~]# rz
yum安装
[root@localhost ~]# yum -y install python-jinja2-2.7.2-4.el7.noarch.rpm
[root@localhost ~]# yum install -y ansible
生成公钥/私钥
[root@localhost ~]# ssh-keygen -t rsa
Generating publ