我是刚接触过Ansible的人,我遇到了一些错误。我的目标是能够管理Fortigate/Cisco设备。
我创建了一个Ubuntu (22.04),其中包含了运行Ansible所需的所有必要包。我使用防火墙组创建了一个非常基本的hosts文件:
[firewalls]
10.23.60.120
10.23.60.122我成功地点击了每个防火墙,并使用SSH连接到了防火墙。但是,一旦我试图使用-m ping模块来平平防火墙,我就会得到以下错误:
ansible -i hosts firewalls -m ping
[WARNING]: Platform unknown on host 10.23.60.120 is using the discovered Python
interpreter at /usr/bin/python, but future installation of another Python
interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.13/reference_appendices/interpreter_discovery.html for more information.
10.23.60.120 | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
}
"changed": false,
"module_stderr": "Shared connection to 10.23.60.120 closed.\r\n",
"module_stdout": "TR1-SDWAN-LAB-01 # 8415: Unknown action 0\r\nCommand fail. Return code
-1\r\n\r\n TR1-SDWAN-LAB-01 # ",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 0
}任何帮助都是非常感谢的。
发布于 2022-10-05 02:32:39
根据提供的信息,您似乎试图建立到交换机的SSH连接。这样的设备可能不具备Python脚本的所有功能。
因为模块--尝试连接到主机,验证可用的python并在成功时返回pong。它
最重要的信息是错误消息Unknown action 0,根据Fortigate文档.命令语法,它只是一个未知的命令
“如果不输入已知的命令,CLI将返回一条错误消息,如:
Unknown action 0”
进一步背景信息
相似Q&A
https://stackoverflow.com/questions/73953357
复制相似问题