可能是由于操作系统和FortiOS版本之间的兼容性问题导致的。尝试升级FortiOS固件,或者在playbook中添加以下行以绕过错误:
tasks:
name: ping fortigate fortios_system_api_exec: vdom: root endpoint: 'https://{{inventory_hostname}}/logincheck' username: 'admin' password: 'password' scope: global params: url: /sys/ping data: source: 192.168.1.1 destination: 192.168.1.2 method: post validate_certs: no register: result
debug: var=result
注意:请将“source”和“destination”替换为您要测试的IP地址。
如果仍然遇到问题,请检查您的Ansible和FortiOS版本是否兼容,并确保使用的模块和参数有效。