ansible的安装
- 安装EPEL作为安装ansible的yum源
rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- 安装Ansible
yum install ansible -y
- 配置文件:
路径:/etc/ansible/hosts
配置说明:问别人v而是为组名,下面的ip或域名则是属于该组的主机
[webservers]
192.168.6.160
- 测试
[root@localhost python]# ansible webservers -m ping -k
SSH password:
192.168.6.160 | SUCCESS => {
"changed": false,
"ping":