ansible问题

问题1:
如果ssh的known_hosts文件被删除,远程登陆的时候会出现提示yes/no,ansible不能自动 处理则报错如下: [root@ansible ~]# ansible web2 -a ‘uptime’ web2 | FAILED | rc=-1 >> Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host’s fingerprint to your known_hosts file to manage this host.

解决:扫描远程主机信息添加到known_hosts文件 [root@ansible ~]# ssh-keyscan web2 >> /root/.ssh/known_host

问题2:
synchronize 模块使用
fatal: [test-5]: FAILED! => {“changed”: false, “cmd”: “/usr/bin/rsync --delay-updates -F》》》》
找到命令\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: remote command not found (code 127) at io.c(226) [sender=3.1.2]\n”, “rc”: 127}

解决:被控制节点未安装rsync服务

你可能感兴趣的:(ansible)