Zam*_*oth -1 automation ubuntu ansible
我刚刚开始研究 Ansible 以及它如何改善我的工作。话虽如此,当我尝试使用 Ansible () 对主机执行 ping 操作时,我遇到了问题ansible all -m ping -vv。Ansible 安装在主机 A 上,主机 B 在 /etc/ansible/hosts 上配置。两台主机都运行 Ubuntu 16.04.03 LTS,我可以在没有密码的情况下从 A 到 B 进行 SSH。
Ansible ping 返回
172.28.25.81 | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Shared connection to 172.28.25.81 closed.\r\n",
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE",
"rc": 0
}
Run Code Online (Sandbox Code Playgroud)
我的软件版本是:
自从您开始使用 Ansible 以来,我相信您已经阅读了ping模块的用途(在这种情况下仅阅读标题就足够了):
\n\n\nping - 尝试连接到主机,验证可用的 python 并在成功时返回\xc2\xa0pong\xc2\xa0
\n
安塞布尔告诉你:
\n\n\n\n\n/bin/sh: 1: /usr/bin/python: 未找到
\n
所以它可能无法“验证可用的Python ”。
\n\n这是有原因的:Ubuntu 16.04 没有安装 Python 2,因此 Ansible 无法运行/usr/bin/python可执行文件。
你需要:
\n\nansible_python_interpreter设置。