1、安装阿里云epel源
2、yum install ansible
3、默认的inventory文件/etc/ansible/hosts
hosts文件格式
[group1] 10.1.1.1 10.1.1.1:1008 server01 ansible_host=10.1.1.1 ansible_port=49159 ansible_user=root ansible_ssh_pass=123456
4、ansible命令 ansible <host-pattern> [options]
4.1 <host-pattern>
ip地址或别名 组名 all * #支持正则和统配符,更多参考http://www.ansible.com.cn/docs/intro_patterns.html
4.2 [options]
原文:https://www.cnblogs.com/huang99882008/p/10453245.html