我的清單文件ansible平模塊連接失敗
bash ~ cat inventory
輸出
[webservers]
testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
當我嘗試連接
bash ~ ansible 127.0.0.1 -i inventory -m ping
它得到了成功的
127.0.0.1 | success >> {
"changed": false,
"ping": "pong"
}
當我使用網絡服務器從inventory file
bash ~ ansible webservers -i inventory -m ping
它失敗,下面的錯誤
testserver | FAILED => SSH encountered an unknown error
during the connection. We recommend you re-run the command using -vvvv,
which will enable SSH debugging output to help diagnose the issue
我能想出的這個問題
您是否嘗試在命令末尾添加-vvvv標誌以查看正在使用的SSH命令以及可能產生的錯誤? – 2015-02-06 16:46:54
您的testserver | FAILED => SSH遇到未知錯誤,不是網絡服務器,請檢查它 – 2015-02-07 15:47:14