安装完ansible之后执行命令报错,报错命令:
ansible -i ~/hosts test -m shell -a'hostname'
127.0.0.1 | FAILED | rc=0 >>
MODULE FAILURE
192.168.100.2 | FAILED | rc=0 >>
MODULE FAILURE
解决:
vim ~/.ansible.cfg
[defaults]
hostfile = ~/hosts
remote_user = root
private_key_file = ~/.ssh/id_rsa
host_key_checking = False