环境准备
|
|
管理端 |
192.168.162.20 |
被管理端1 |
192.168.162.30 |
被管理端2 |
192.168.162.5 |
1、关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
2、安装相关软件
[root@localhost ~]# yum -y install epel-release.noarch
[root@localhost ~]# yum install -y ansible
[root@localhost ~]# yum install -y tree
[root@localhost ~]# tree /etc/ansible/
/etc/ansible/
├── ansible.cfg #ansible配置文件
├── hosts #管理主机的文件,主机清单
└── roles
3、修改主机清单