ansible-collections / cisco.iosxr

Ansible Network Collection for Cisco IOSXR
GNU General Public License v3.0
67 stars 47 forks source link

Resource module cisco.iosxr.iosxr_interfaces is not returning facts for with new collection version 5.0.3 #403

Closed digitalfiend64 closed 1 year ago

digitalfiend64 commented 1 year ago

SUMMARY

Resource module cisco.iosxr.iosxr_interfaces is not returning facts for with new collection version 5.0.3. Tested on Ansible 2.13. Gather facts errors out with below error message: TASK [yeti.netcommon.collect_facts : Gather Cisco Network Facts] **** task path: /home//.ansible/collections/ansible_collections/yeti/netcommon/roles/collect_facts/tasks/cisco.iosxr.iosxr/network_facts.yml:2 The full traceback is: File "/home//.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py", line 135, in get_network_resources_facts inst.populate_facts( File "/home//.ansible/collections/ansible_collections/cisco/iosxr/plugins/module_utils/network/iosxr/facts/l2_interfaces/l2_interfaces.py", line 70, in populate_facts obj = self.render_config(self.generated_spec, conf) File "/home//.ansible/collections/ansible_collections/cisco/iosxr/plugins/module_utils/network/iosxr/facts/l2_interfaces/l2_interfaces.py", line 132, in render_config config["q_vlan"].append(int(dot1q.split(" ")[0])) fatal: [ASR9K-01]: FAILED! => { "changed": false, "invocation": { "module_args": { "available_network_resources": false, "gather_network_resources": [ "l3_interfaces", "l2_interfaces", "lldp_interfaces", "interfaces", "acl_interfaces", "lag_interfaces" ], "gather_subset": [ "interfaces" ] } }, "msg": "invalid literal for int() with base 10: '2900-2902'" }

ISSUE TYPE
COMPONENT NAME

cisco.iosxr.iosxr_interfaces

ANSIBLE VERSION
(ansible213) [<REDACTED>@YETI_RHEL8 yeti-modular-network-services]$ ansible --version
ansible [core 2.13.4]
  config file = /home/<REDACTED>/.ansible.cfg
  configured module search path = ['/home/<REDACTED>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/<REDACTED>/ansible213/lib64/python3.8/site-packages/ansible
  ansible collection location = /home/<REDACTED>/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/<REDACTED>/ansible213/bin/ansible
  python version = 3.8.12 (default, Sep 16 2021, 10:46:05) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
[<REDACTED>@YETI_RHEL8 ~]$ ansible-galaxy collection list cisco.iosxr

# /home/<REDACTED>/.ansible/collections/ansible_collections
Collection  Version
----------- -------
cisco.iosxr 5.0.3
[<REDACTED>@YETI_RHEL8 ~]$
CONFIGURATION
(ansible213) [<REDACTED>@YETI_RHEL8 yeti-modular-network-services]$ ansible-config dump --only-changed
DEFAULT_EXECUTABLE(/home/<REDACTED>/.ansible.cfg) = /bin/bash
DEFAULT_JINJA2_EXTENSIONS(/home/<REDACTED>/.ansible.cfg) = jinja2.ext.do,jinja2.ext.i18n
DEFAULT_LOCAL_TMP(/home/<REDACTED>/.ansible.cfg) = /home/<REDACTED>/.ansible/tmp/ansible-local-30690367hzw0nob
DEFAULT_LOG_PATH(/home/<REDACTED>/.ansible.cfg) = /home/<REDACTED>/.ansible/log
DEFAULT_REMOTE_PORT(/home/<REDACTED>/.ansible.cfg) = 22
DEFAULT_STDOUT_CALLBACK(/home/<REDACTED>/.ansible.cfg) = skippy
DEFAULT_TIMEOUT(/home/<REDACTED>/.ansible.cfg) = 1800
DEFAULT_TRANSPORT(/home/<REDACTED>/.ansible.cfg) = smart
DEPRECATION_WARNINGS(/home/<REDACTED>/.ansible.cfg) = False
DISPLAY_SKIPPED_HOSTS(/home/<REDACTED>/.ansible.cfg) = True
GALAXY_IGNORE_CERTS(/home/<REDACTED>/.ansible.cfg) = True
GALAXY_SERVER_LIST(/home/<REDACTED>/.ansible.cfg) = ['published_repo', 'rh-certified_repo', 'release_galaxy']
HOST_KEY_CHECKING(/home/<REDACTED>/.ansible.cfg) = False
PARAMIKO_HOST_KEY_AUTO_ADD(/home/<REDACTED>/.ansible.cfg) = True
PERSISTENT_COMMAND_TIMEOUT(/home/<REDACTED>/.ansible.cfg) = 1800
PERSISTENT_CONNECT_TIMEOUT(/home/<REDACTED>/.ansible.cfg) = 120
RETRY_FILES_ENABLED(/home/<REDACTED>/.ansible.cfg) = False
OS / ENVIRONMENT

Cisco IOS XR Software, Version 6.5.3


yeti_network_services:   - configs:          # l3 loopback config block     - interfaces:     # interfaces module       - name: loopback64         description: TEST LOOPBACK DESCRIPTION       state: merged     - l3_interfaces:  # l3_interfaces module       - name: loopback64         ipv4:         - address: 192.168.1.3/31       state: merged



<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS

The gathered facts returned should contain facts from all interfaces network resources for the iosxr device instead of erroring out.

net_gather_network_resources:
- l3_interfaces
- lag_interfaces
- lldp_interfaces
- l2_interfaces
- acl_interfaces
- interfaces

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra
verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```paste below
Encountered the error at gather facts task

PLAY [Network Services Implementation] ****************************************************************************

TASK [Remove 'CR' from CR_number] *********************************************************************************
ok: [ASR9K-01]

TASK [Gather fact subsets for network services] *******************************************************************
ok: [ASR9K-01]

TASK [yeti.netcommon.collect_facts : include_tasks] ***************************************************************
included: /home/<REDACTED>/.ansible/collections/ansible_collections/yeti/netcommon/roles/collect_facts/tasks/network_facts.yml for ASR9K-01

TASK [yeti.netcommon.collect_facts : Gather <REDACTED> Network Facts] ***********************************************
ok: [ASR9K-01]

TASK [yeti.netcommon.collect_facts : include_tasks] ***************************************************************
included: /home/<REDACTED>/.ansible/collections/ansible_collections/yeti/netcommon/roles/collect_facts/tasks/cisco.iosxr.iosxr/network_facts.yml for ASR9K-01

TASK [yeti.netcommon.collect_facts : Gather Cisco Network Facts] **************************************************
fatal: [ASR9K-01]: FAILED! => {"changed": false, "msg": "invalid literal for int() with base 10: '2900-2902'"}

TASK [Set baseline to false] **************************************************************************************
ok: [ASR9K-01]

TASK [Rollback Type 2 - Set global_precheck to false for neighbors] ***********************************************

TASK [Rollback Type 5 - Set global_precheck to false for all devices] *********************************************
ok: [ASR9K-01] => (item=Failed on ASR9K-01 - Set All hosts to false)

TASK [yeti.netcommon.validations : Gather facts] ******************************************************************

TASK [yeti.netcommon.validations : Gather Cisco Network Facts] ****************************************************

TASK [yeti.netcommon.validations : include_tasks] *****************************************************************

TASK [include_tasks] **********************************************************************************************

PLAY [Pier metrics and messages] **********************************************************************************

TASK [yeti.messaging.network_implementation_end_messages : include_tasks] *****************************************
included: /home/<REDACTED>/.ansible/collections/ansible_collections/yeti/messaging/roles/network_implementation_end_messages/tasks/implementation_messages.yml for ASR9K-01

TASK [yeti.messaging.network_implementation_end_messages : ansible.builtin.fail] **********************************
fatal: [ASR9K-01]: FAILED! => {"changed": false, "msg": "ASR9K-01 - PLAYBOOK BASELINE FAILED. UNABLE TO START IMPLEMENTATION"}

PLAY RECAP ********************************************************************************************************
ASR9K-01                   : ok=8    changed=0    unreachable=0    failed=1    skipped=5    rescued=1    ignored=0

(ansible213) [<REDACTED>@YETI_RHEL8 yeti-modular-network-services]$
ashwini-mhatre commented 1 year ago

@digitalfiend64 could you please share output of "show running-config interface " command