Open Pr1meSuspec7 opened 2 months ago
@Pr1meSuspec7,
Thank you for reaching out. Unfortunately, we do not support Version 15.6(1)T of the device. Our supported versions include 17.x and above. Could you please check if the issue persists with a 17.x version and let us know? We’d be happy to assist further based on that.
Hi @roverflow, thanks for your reply. I just tested on CSR1000v with version software 17.3 and the error persists, but I found the problem:
The issue is in this section of module cisco.ios.ios_vrf:
for want_mdt in want["address_family"]:
afi = want_mdt["afi"]
af_dict = {}
data_dict = want_mdt["mdt"].pop("data", {}) # <-- this is the guilty
This section tries to make a "pop" of "data" key in the "mtd" dictonary and if you don't define the "mtd" and "data" dictonary in the ansible task you get the error mentioned in this issue.
I solved the task execution by defining “mtd” and “date” in the playbook task:
- name: Configure a vrf named management
cisco.ios.ios_vrf:
name: RED
description: RED VRF
address_family:
- afi: ipv4
mdt: # <-- insert mdt without value
data: # <-- insert data without value
interfaces:
- GigabitEthernet4
In this case the playbook works:
PLAY [CONFIGURING VRF] *************************************************************************************************************************************************************************************************
TASK [Configure a vrf named management] ********************************************************************************************************************************************************************************
changed: [CSR1]
PLAY RECAP *************************************************************************************************************************************************************************************************************
CSR1 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
But we don't have the expected result:
CSR1000v#show run vrf RED
Building configuration...
Current configuration : 169 bytes
vrf definition RED
description RED VRF
!
! <- address-family missing
!
interface GigabitEthernet4
vrf forwarding RED
no ip address
shutdown
negotiation auto
no mop enabled
no mop sysid
end
Thanks a lot Marco
yes, I have the same problem
tasks:
- name: Configure VRF
cisco.ios.ios_vrf:
address_family:
- afi: ipv4
name: CUST-A
description: VRF CUST-A
rd: 1:100
state: present
This task produce this error
fatal: [device.com]: FAILED! => {
"changed": false,
"module_stderr": "'NoneType' object has no attribute 'pop'",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
The right configuration should be:
vrf definition CUST-A
description VRF CUST-A
rd 1:100
!
address-family ipv4
exit-address-family
(venv) ➜ ansible --version
ansible [core 2.17.3]
(venv) ➜ ansible ansible-galaxy collection list | grep ios
cisco.ios 9.0.1
Cat8000V#sh ver
Cisco IOS XE Software, Version 17.12.02
Cisco IOS Software [Dublin], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.12.2, RELEASE SOFTWARE (fc2)
I can see what is a difference. NX-OS has module which deals with address-families
SUMMARY
The cisco.ios.ios_vrf module rises an error when add "address-family" parameter:
ISSUE TYPE
COMPONENT NAME
cisco.ios.ios_vrf
ANSIBLE VERSION
COLLECTION VERSION
-->
CONFIGURATION
OS / ENVIRONMENT
target OS:
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS