ansible /usr/bin/python: not found

  使用ansible命令的时候出错

ansible all -m ping

  出现报错

192.168.199.154 | FAILED! => {
    "changed": false, 
    "module_stderr": "/bin/sh: 1: /usr/bin/python: not found
", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE
See stdout/stderr for the exact error", 
    "rc": 127
}

  检查了一下执行ansible命令的主机已经装了python,那怎么提示not found?

  最终找到原因时它在其他节点上也是依赖python的,所以其他节点上也要安装python

apt-get install python2.7
# Ubuntu16.04可能需要配置以下软连接
ln -s /usr/bin/python2.7 /usr/bin/python

 

原文地址:https://www.cnblogs.com/yuxiaoba/p/10113395.html