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

GNU General Public License v3.0
84 stars 48 forks source link

fortios_vpn_ipsec_phase1_interface Error creating new Interface 7.0.12 #266

Closed cronosy closed 11 months ago

cronosy commented 12 months ago

Greetings team. I'm trying create a new interface using the module in the subject but fail with the next error: Traceback (most recent call last): File "/home/alejandro/.ansible/tmp/ansible-local-30929dpucodhn/ansible-tmp-1693434097.2639806-31022-167484448443451/AnsiballZ_fortios_vpn_ipsec_phase1_interface.py", line 107, in _ansiballz_main() File "/home/alejandro/.ansible/tmp/ansible-local-30929dpucodhn/ansible-tmp-1693434097.2639806-31022-167484448443451/AnsiballZ_fortios_vpn_ipsec_phase1_interface.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/alejandro/.ansible/tmp/ansible-local-30929dpucodhn/ansible-tmp-1693434097.2639806-31022-167484448443451/AnsiballZ_fortios_vpn_ipsec_phase1_interface.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.fortinet.fortios.plugins.modules.fortios_vpn_ipsec_phase1_interface', init_globals=dict(_module_fqn='ansible_collections.fortinet.fortios.plugins.modules.fortios_vpn_ipsec_phase1_interface', _modlib_path=modlib_path), File "/usr/lib/python3.10/runpy.py", line 224, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload_ezshv10x/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_vpn_ipsec_phase1_interface.py", line 14543, in File "/tmp/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload_ezshv10x/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_vpn_ipsec_phase1_interface.py", line 14505, in main File "/tmp/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload_ezshv10x/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload.zip/ansible_collections/fortinet/fortios/plugins/module_utils/fortios/fortios.py", line 220, in check_schema_versioning File "/tmp/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload_ezshv10x/ansible_fortinet.fortios.fortios_vpn_ipsec_phase1_interface_payload.zip/ansible/module_utils/connection.py", line 200, in rpc ansible.module_utils.connection.ConnectionError: Expecting value: line 1 column 1 (char 0)

alagoutte commented 12 months ago

What your playbook ?

cronosy commented 12 months ago

Hello folks. I've continue doing debugging and could validate that to connection.py file in class Connection method rpc there is a call to _exec_jsonrpc() apparently the kwargs is empty and fail the connection request. What could be reason that kwargs it's been sent empty?

What your playbook ? Thanks for your help. I had to replace the sensitive information

below the debug Ansible playbook task.args {'vdom': 'xxxx9', 'state': 'present', 'access_token': 'xxxxxx', 'vpn_ipsec_phase1_interface': {'comments': 'TestIndividual', 'local_gw': 'x.x.x.x', 'dhgrp': '14', 'dpd': 'on-idle', 'dpd_retryinterval': 5, 'interface': 'untrust/1499', 'name': 'TestIndividual', 'nattraversal': 'enable', 'net_device': 'disable', 'peertype': 'any', 'keylife': 86400, 'proposal': 'aes256-sha256', 'psksecret': '1276554843', 'remote_gw': 'x.x.x.x', 'wizard_type': 'custom', 'ike_version': '2'}, '_ansible_check_mode': False, '_ansible_no_log': False, '_ansible_debug': False, '_ansible_diff': False, '_ansible_verbosity': 3, '_ansible_version': '2.15.3', '_ansible_module_name': 'fortinet.fortios.fortios_vpn_ipsec_phase1_interface', '_ansible_syslog_facility': 'LOG_USER', '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'vfat'], '_ansible_string_conversion_action': 'warn', '_ansible_socket': '/home/alejandro/.ansible/pc/fa638a94d4', '_ansible_shell_executable': '/bin/sh', '_ansible_keep_remote_files': True, '_ansible_tmpdir': '/home/alejandro/.ansible/tmp/ansible-local-81665gn900_7/ansible-tmp-1693510109.1716297-9669-182279193395119/', '_ansible_remote_tmp': '~/.ansible/tmp'}

The same playbook works in a firewall version v6.4.11.

kind regards

cronosy commented 11 months ago

Hello guys. Anybody have could check this issue? I'm thankful if somebody could help me with the issue.

kind regards,.

JieX19 commented 11 months ago

Hi @cronosy,

I tried the same playbook in my environment (7.0.12 and 6.4.11), and it works. May I know the Fortios collection version you're using?

Using the command ansible-galaxy collection install fortinet.fortios:2.3.2 to upgrade to the latest version.

BTW, the parameter net_device is not supported in this module.

Can you please upgrade the collection version and try it again? Let me know if it still shows the same error.

cronosy commented 11 months ago

Hi @cronosy,

I tried the same playbook in my environment (7.0.12 and 6.4.11), and it works. May I know the Fortios collection version you're using?

Using the command ansible-galaxy collection install fortinet.fortios:2.3.2 to upgrade to the latest version.

BTW, the parameter net_device is not supported in this module.

Can you please upgrade the collection version and try it again? Let me know if it still shows the same error.

Thanks for you reply. You are right. My mistake was the collection version. Now, I'm checking my environment and evaluating the impact in the rest of the integration. Thanks a lot by your help.