Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playbook test doesn't work #4

Closed
abraxxa opened this issue Nov 13, 2019 · 4 comments
Closed

playbook test doesn't work #4

abraxxa opened this issue Nov 13, 2019 · 4 comments

Comments

@abraxxa
Copy link

abraxxa commented Nov 13, 2019

After searching for some hours and not finding a single hint about what might be wrong I hope I get help here.

OS: Ubuntu 19.10
Ansible 2.9.0 installed via official PPA
FortiManager installed on KVM locally in a NATed network
JSON RPC access is enabled for the admin user
Wireshark shows that Ansible isn't even trying to connect

Setting python2 or python3 didn't change anything but the deprecation warning, the error message from the module remains the same.

And finally here the error message:

PLAY [FMGR CONNECTION GET SYS STATUS] ****************************************************************************************************************************************************************************************************************************************************************************************

TASK [TEST FMGR CONNECTION GET SYS STATUS] ***********************************************************************************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.network.fortimanager.common.FMGBaseException: An attempt was made at communicating with a FMG with no valid session and an unexpected error was discovered.
[DEPRECATION WARNING]: Distribution Ubuntu 19.10 on host fmg should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will 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 be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [fmg]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/ahartmai/.ansible/tmp/ansible-local-18830lpQ1iC/ansible-tmp-1573668092.64-29563260635049/AnsiballZ_fmgr_query.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/ahartmai/.ansible/tmp/ansible-local-18830lpQ1iC/ansible-tmp-1573668092.64-29563260635049/AnsiballZ_fmgr_query.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/ahartmai/.ansible/tmp/ansible-local-18830lpQ1iC/ansible-tmp-1573668092.64-29563260635049/AnsiballZ_fmgr_query.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.fortimanager.fmgr_query', init_globals=None, run_name='__main__', alter_sys=False)\n  File \"/usr/lib/python2.7/runpy.py\", line 192, in run_module\n    fname, loader, pkg_name)\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/tmp/ansible_fmgr_query_payload_4gMw5r/ansible_fmgr_query_payload.zip/ansible/modules/network/fortimanager/fmgr_query.py\", line 431, in <module>\n  File \"/tmp/ansible_fmgr_query_payload_4gMw5r/ansible_fmgr_query_payload.zip/ansible/modules/network/fortimanager/fmgr_query.py\", line 425, in main\nansible.module_utils.network.fortimanager.common.FMGBaseException: An attempt was made at communicating with a FMG with no valid session and an unexpected error was discovered.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *******************************************************************************************************************************************************************************************************************************************************************************************************************
fmg                        : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Thanks!

@abraxxa
Copy link
Author

abraxxa commented Nov 19, 2019

Downgrading Ansible to 2.8.7 fixed the issue.
Please inform us when your module is fixed and compatible with Ansible 2.9.
Thanks!

@ftntcorecse
Copy link
Owner

We've updated the httpapi plugin to adjust for a connection change that was introduced in 2.9.

https://github.com/ftntcorecse/fndn_ansible/blob/master/fortimanager/plugins/httpapi/fortimanager.py

It's on our FNDN repo for now, and is currently in PR.

@awuetz
Copy link

awuetz commented Dec 2, 2019

Hello @ftntcorecse
is your fix already included in an ansible version?

@ftntcorecse
Copy link
Owner

@awuetz The PR has been approved -- it will be in version 2.10 when it is released. If you're so inclined you can also pick it up off the devel branch of the Ansible repo itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants