亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Ansible 中的回溯錯誤(Python 版本不匹配?)

Ansible 中的回溯錯誤(Python 版本不匹配?)

jeck貓 2023-06-20 13:47:22
運行以下命令時出現回溯錯誤ansible-playbook -i hosts fmg-playbooks/01_add_model_device.yml我正在運行 Ansible 2.9 和 Python 3.6.5ansible 2.9.11  config file = /home/alice/ansible/ansible.cfg  configured module search path = ['/home/alice/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']  ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible  executable location = /usr/local/bin/ansible  python version = 3.6.5 (default, Apr  1 2018, 05:46:30) [GCC 7.3.0]我收到有關 Python 版本的警告TASK [Gathering Facts] ***************************************************************************************************************************************************************************************[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host fmg01 should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible releasewill default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This feature will beremoved in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.ok: [fmg01]然后當我嘗試添加設備時,出現回溯錯誤TASK [Add model device] **************************************************************************************************************************************************************************************An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: Method not found這可能是 Ansible 使用錯誤的 Python 解釋器的問題嗎?我可以強制它使用與 2.7 不同的版本嗎?
查看完整描述

1 回答

?
躍然一笑

TA貢獻1826條經驗 獲得超6個贊

Python 版本沒問題。事實證明這是端口的問題。我在我的主機文件中切換到 443,它開始工作了。


[FMG:vars]

ansible_network_os      = fortinet.fortimanager.fortimanager

ansible_httpapi_port    = 443

ansible_httpapi_use_ssl = True

ansible_httpapi_validate_certs = False

ansible_connection = httpapi


查看完整回答
反對 回復 2023-06-20
  • 1 回答
  • 0 關注
  • 174 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號