yum install epel-release -y yum install ansible -y
vim /etc/ansible/hosts [test] 192.168.1.[230:232] [test:vars] ansible_ssh_pass="1"
ansible配置
1> 禁用每次执行ansbile命令检查ssh key host host_key_checking = False 2> 开启日志记录 log_path = /var/log/ansible.log 3> ansible连接加速配置
[accelerate]
#accelerate_port = 5099
accelerate_port = 10000
#accelerate_timeout = 30
#accelerate_connect_timeout = 5.0
# If set to yes, accelerate_multi_key will allow multiple
# private keys to be uploaded to it, though each user must
# have access to the system via SSH to add a new key. The default
# is "no".
accelerate_multi_key = yes
五、测试 最后测试下在三台管理机器批量执行一个ping命令 ansible all -m ping
原文:https://www.cnblogs.com/niwajiang1/p/13495884.html