Open Remey opened 4 years ago
no update for this issue ??
Hi, I had the same issue once that FortiManager has been upgrated up to version 6.4.7. The are both differences within the json structure (e.g. data is not an array anymore) and within some fields (e.g. subnet is not anymore just a string, but an array). Here is the payload that now works for me:
payload = { "id": 1, "method": "add", "params": [ { "url": "put_here_your_url", "data": { "subnet": [ "put_here_your_ipv4", "255.255.255.255" ], "type": 0, "associated-interface": [ "any" ], "allow-routing": 0, "cache-ttl": 0, "clearpass-spt": 0, "color": 0, "comment": "string", "name": "string", } } ], "session": self.session }
Hi,
I have been trying to configure AWX to use Ansible to add changes to our FortiManager.
At the moment I have managed to get fmgr_query (https://ftnt-ansible-docs.readthedocs.io/en/latest/fmgr_modules/fmgr_query.html) to work and return a result.
I am now trying to get fmgr_fwobj_address (https://ftnt-ansible-docs.readthedocs.io/en/latest/fmgr_modules/fmgr_fwobj_address.html) to work but not having much luck, I keep receiving the following error:
{ "msg": "The data is invalid for selected url", "changed": false, "unreachable": false, "ansible_facts": { "response": [ -10, { "status": { "code": -10, "message": "The data is invalid for selected url" }, "url": "/pm/config/adom/root/obj/firewall/address" } ], "ansible_params": { "ipv4": "ipmask", "ipv4addr": "1.2.3.4/32", "name": "AWX_TEST", "comment": "Test", "color": "1", "visibility": "enable", "adom": "root", "mode": "add", "allow_routing": "disable" }, "paramgram": { "adom": "root", "allow-routing": "disable", "color": "1", "comment": "Test", "name": "AWX_TEST", "visibility": "enable", "ipv4": "ipmask", "ipv4addr": "1.2.3.4/32", "mode": "add" }, "connected_fmgr": { "Admin Domain Configuration": "Enabled", "BIOS version": "04000002", "Branch Point": "0429", "Build": "0429", "Current Time": "Mon Feb 03 17:49:04 GMT 2020", "Daylight Time Saving": "Yes", "FIPS Mode": "Disabled", "HA Mode": "HA Master", "Hostname": "opfwmgmt01b", "License Status": "Valid", "Major": 6, "Max Number of Admin Domains": 200, "Max Number of Device Groups": 200, "Minor": 0, "Offline Mode": "Disabled", "Patch": 8, "Platform Full Name": "FortiManager-VM64", "Platform Type": "FMG-VM64", "Release Version Information": " (GA)", "Serial Number": "FMG-VM0A14003861", "Time Zone": "(GMT) London, Edinburgh.", "Version": "v6.0.8-build0429 200121 (GA)", "x86-64 Applications": "Yes" }, "discovered_interpreter_python": "/usr/libexec/platform-python" }, "rc": -10, "invocation": { "module_args": { "ipv4": "ipmask", "ipv4addr": "1.2.3.4/32", "name": "AWX_TEST", "comment": "Test", "color": "1", "visibility": "enable", "adom": "root", "mode": "add", "allow_routing": "disable" } }, "ansible_module_results": { "status": { "code": -10, "message": "The data is invalid for selected url" }, "url": "/pm/config/adom/root/obj/firewall/address" }, "_ansible_no_log": false }
I have noticed that the main difference is in the Old one the type is 0 ("type": 0). On the New one the type is ipmask ("type": "ipmask”). I am not to sure why this is or how to allow FortiManager to accept (ipmask).
Would you know how best to troubleshoot this or be able to help us figure out this problem?
If you need any more info please let me know.
python3.6
Ansible 2.8.5 AWX 9.0.1.0
Many Thanks, Remey