fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
85 stars 49 forks source link

Connection Error with FortiOS 7.4.5 #359

Open PhilooLinux opened 12 hours ago

PhilooLinux commented 12 hours ago

Hello,

I am using several playbooks against many Fortigate (50+) and recently I see all the ones running with FortiOS 7.4.5 failing with the error message: The error was: ansible.module_utils.connection.ConnectionError: Expecting value: line 1 column 1 (char 0)

I am using:

ansible [core 2.17.6]
  config file = /home/ansible/setup/firewall/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

and

ansible-galaxy collection list | grep fortios
fortinet.fortios                         2.3.8
fortinet.fortios                         2.3.8

Looking at the FortiOS Release Notes for 7.4.5, I fail to see any known issue or change regarding Rest API.

Could you help me solving this problem? Thanks.

MaxxLiu22 commented 15 minutes ago

Hi @PhilooLinux ,

Thank you for raising this issue. I tested this on my FOS 7.4.5, and everything worked as expected. However, I encountered the same issue when I provided an incorrect token in the following configuration: ansible_httpapi_session_key={"access_token":"rkknN4QQ...."} in host file. Could you please double-check if your token is valid? If that is not the reason, could you provide more details, such as your host file and playbook configuration, the authentication method you are using (token or username/password), and any other relevant information?

Thanks, Maxx