1. 程式人生 > >ansible /usr/bin/python: not found

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