ansible
准备两台虚拟机192.168.1.217 192.168.1.218
在192.168.1.17进行操作
1.安装epel
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
2.安装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
yum install -y .yum install -y python
3.yum install -y ansible
4.编辑配置文件
cd /etc/ansible/
vim hosts
在末尾添加
5.vim /etc/ansible/ansible.cfg
注释两行
6.验证
ansible test -a ‘uptime’
ansible -m ping “test”
在192.168.1.217上创建文档1和2
在192.168.1.218上查看