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\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\nSee 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

 

 

posted @ 2018-12-13 13:07  yuxiaoba  阅读(3443)  评论(0编辑  收藏  举报