-
Notifications
You must be signed in to change notification settings - Fork 104
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
network_resource module failing against specific resource modules #512
Comments
Had a play at debugging the playbook with "-vvv" and spotted that the working resource modules were being redirected to the actual underlying network provider module name:
Specifically redirecting - name: Fetch config for failing modules
ansible.netcommon.network_resource:
# os_name: "{{ network_resource_info.ansible_network_os }}"
name: "{{ item }}"
state: gathered
loop:
- ios_bgp_address_family
- ios_ospf_interfaces
- ios_ospfv2
- ios_ospfv3
ignore_errors: true
register: failing_module_info And what do you know, the task no longer fails:
So there seems to be some sort of issue with the mapping and searching of the resource names that are pulled back using the Hope this helps identify and fix the issue. |
SUMMARY
Using the ansible.netcommon.network_resource module against a working, from Ansible's point of view, network device (Cisco IOS, CSR1000V) fails when specific resource modules, that are known to be available for the device, are referenced.
The resource modules causing the failure have been identified as:
ISSUE TYPE
COMPONENT NAME
ansible.netcommon.network_resource
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Targeted network device info:
The below table collates the device's hardware information:
The following table collates the device's software information
STEPS TO REPRODUCE
Run the below playbook against the Cisco Always-On latest IOSXE device:
ciscoao_latest_iosxe:
ansible_host: sandbox-iosxe-latest-1.cisco.com
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.ios.ios
ansible_user: developer
ansible_password: C1sco12345
EXPECTED RESULTS
The first task in the playbook registers all the available modules for the device/host being targeted, with the subsequent task outputting them so we can see what's available.
The "Fetch config for working modules" task contains a partial list of the modules found to be available, which it runs through, as expected. The first 2 modules in the list work without issue and their outputs are collected. The last module "vlans" fails with an appropriate error message, which I have no real issue with (there are no vlans on the device, so this could be the cause).
However, the "Fetch config for failing modules" task contains the list of modules I've isolated down which cause the task to fail with a python based error, when targeting either 1 or all of them. This is the issue that is completely breaking things for me and I'd like help understanding and, if possible, fixing.
ACTUAL RESULTS
The "Fetch config for failing modules" task fails with a python error message as seen below:
The text was updated successfully, but these errors were encountered: