Open Yannis100 opened 2 years ago
Hello, i just setup my environment. I was able to replicate this and will see what needs to be change din the code in order to make it work.
hello folks, thanks for reporting this!
@LindsayHill @ujwalkomarla @rdvencioneck @hlrichardson @jayalakshmiV you're authors/maintainers of related modules, if you take a look, it'd be great
I took a look at this issue, because i wanted to use the facts gathered using gather_network_resources.
The gather_network_resources parameter does not yet support ansible.netcommon.network_cli
, it only supports ansible.netcommon.httpap
i.
Workaround would be to add ansible_connection: ansible.netcommon.httpapi
to the module call like so:
- exos_facts:
gather_subset: "!all"
gather_network_resources: all
vars:
ansible_connection: ansible.netcommon.httpapi
As you can see for example in:
https://github.com/ansible-collections/community.network/blob/312b5d87cbb73f17acd4d254889145228d35fb19/plugins/module_utils/network/exos/facts/lldp_global/lldp_global.py#L59
the API path is hardcoded and it only imports/calls the send_requests function in every subset class.
ansible.netcommon.network_cli
only implements run_commands
,
ansible.netcommon.httpapi
supports both run_commands and send_requests.
Using the HTTP/REST API is much cleaner and simpler than parsing command output. The later is more complex and error prone.
I don't know if there are use cases that only allow for using network_cli and not httpapi, so i have not yet taken the time to look into implementing gather_network_resources for network_cli.
I will add a commit to my PR #558 to clarify that in the module documentation.
SUMMARY
When using exos_facts module with gather_network_resources parameter (whatever the value is) with ansible_connection: ansible.netcommon.network_cli and network_os: community.network.exos the following error happens :
'Cli' object has no attribute 'send_requests'
ISSUE TYPE
COMPONENT NAME
exos_facts.py
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04 on WSL2 Extreme EXOS version 22.7.1.2 & 30.7.1.1 & 31.7.1.4
STEPS TO REPRODUCE
EXPECTED RESULTS
The module should work and return/set network_resources facts for the host
ACTUAL RESULTS
An error stops the module from working and triggers a fatal error