ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
294 stars 171 forks source link

valid route maps generating 'route_map' is undefined error in cisco.ios.ios_route_maps #557

Closed nspitzer closed 2 years ago

nspitzer commented 2 years ago
SUMMARY

valid route maps generating "'route_map' is undefined error" in cisco.ios.ios_route_maps parser . Additionally testing showed valid YAML to create route map generating identical error in renderer.

Desired route map config was: route-map BGP_TO_EC permit 10 \n match ip address prefix-list DEFAULT !

ISSUE TYPE
COMPONENT NAME

cisco.ios.ios.route_maps

ANSIBLE VERSION
ansible 2.10.8
  config file = /home/nspitzer/.ansible.cfg
  configured module search path = ['/home/nspitzer/.ansible/collections/ansible_collections']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0]
COLLECTION VERSION
Collection Version
---------- -------
cisco.ios  2.8.1  

# /usr/lib/python3/dist-packages/ansible_collections
Collection Version
---------- -------
cisco.ios  1.3.0  
CONFIGURATION
DEFAULT_HOST_LIST(/home/nspitzer/.ansible.cfg) = ['/home/share/ansible/hosts']
DEFAULT_MODULE_PATH(/home/nspitzer/.ansible.cfg) = ['/home/nspitzer/.ansible/collections/ansible_collections']
OS / ENVIRONMENT

nspitzer@ansibletest:/home/share/ansible$ ansible-config dump --only-changed DEFAULT_HOST_LIST(/home/nspitzer/.ansible.cfg) = ['/home/share/ansible/hosts'] DEFAULT_MODULE_PATH(/home/nspitzer/.ansible.cfg) = ['/home/nspitzer/.ansible/collections/ansible_collections']

STEPS TO REPRODUCE
  1. Apply the following configuration to a router and run the playbook below against the router:
    ip prefix-list DEFAULT seq 5 permit 0.0.0.0/0
    !
    !
    route-map BGP_TO_EC permit 10 
    match ip address prefix-list DEFAULT
    !
---
- name: IOS Template Parse
  hosts: all
  gather_facts: yes
  collections:
  - cisco.ios
  become: yes

  tasks:

  - name: Gather all legacy facts
    ios_facts:
      gather_subset: all

  - name: Gather existing running Config
    ios_command:
      commands: 
        - command: sh running-config | section ^route-map
    register: running_route_map

  - name: display intput for parser task
    debug:
      var: running_route_map.stdout[0]

  - name: parse existing route map Config 
    ios_route_maps:
      running_config: "{{ running_route_map.stdout[0] }}"
      state: parsed 
    register: route_maps_parsed

  - name: render parsed route map Config 
    ios_route_maps:
      running_config: "{{ route_maps_parsed.parsed[0] }}"
      state: rendered 
    register: route_maps_rendered

  - name: Print rendered config
    debug:
      var:  route_maps_rendered
EXPECTED RESULTS

The following YAML should be displayed: `cisco.ios.ios_route_maps: config:

ACTUAL RESULTS

Error is generated: "msg": "'route_map' is undefined" in parser task. Note same error occurs feeding valid YAML to render

ansible-playbook 2.10.8
  config file = /home/<SOME USERNAME>/.ansible.cfg
  configured module search path = ['/home/<SOME USERNAME>/.ansible/collections/ansible_collections']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0]
Using /home/<SOME USERNAME>/.ansible.cfg as config file
host_list declined parsing /home/share/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /home/share/ansible/hosts as it did not pass its verify_file() method
Parsed /home/share/ansible/hosts inventory source with yaml plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: ios_config_routemap_parse.yml **********************************************************************************************************************************************
1 plays in ios_config_routemap_parse.yml

PLAY [IOS Template Parse] ************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************
task path: /home/share/ansible/ios_config_routemap_parse.yml:2
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
[WARNING]: Ignoring timeout(10) for ansible.legacy.ios_facts
<10.1.32.161> ESTABLISH LOCAL CONNECTION FOR USER: <SOME USERNAME>
<10.1.32.161> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx `"&& mkdir "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162 `" && echo ansible-tmp-1649516623.6587098-1658-243579367541162="` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ios_facts to cisco.ios.ios_facts
<IOS_VM> Attempting python interpreter discovery
<10.1.32.161> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<10.1.32.161> EXEC /bin/sh -c '/usr/bin/python3.9 && sleep 0'
Using module file /home/<SOME USERNAME>/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_facts.py
<10.1.32.161> PUT /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/tmpn2razc9x TO /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162/AnsiballZ_ios_facts.py
<10.1.32.161> EXEC /bin/sh -c 'chmod u+x /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162/ /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162/AnsiballZ_ios_facts.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c '/usr/bin/python3 /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162/AnsiballZ_ios_facts.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c 'rm -f -r /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516623.6587098-1658-243579367541162/ > /dev/null 2>&1 && sleep 0'
ok: [IOS_VM]
META: ran handlers

TASK [Gather all legacy facts] *******************************************************************************************************************************************************
task path: /home/share/ansible/ios_config_routemap_parse.yml:11
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<10.1.32.161> ESTABLISH LOCAL CONNECTION FOR USER: <SOME USERNAME>
<10.1.32.161> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx `"&& mkdir "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230 `" && echo ansible-tmp-1649516627.721102-1695-78522435585230="` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230 `" ) && sleep 0'
Using module file /home/<SOME USERNAME>/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_facts.py
<10.1.32.161> PUT /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/tmpyxe47vfi TO /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230/AnsiballZ_ios_facts.py
<10.1.32.161> EXEC /bin/sh -c 'chmod u+x /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230/ /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230/AnsiballZ_ios_facts.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c '/usr/bin/python3 /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230/AnsiballZ_ios_facts.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c 'rm -f -r /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516627.721102-1695-78522435585230/ > /dev/null 2>&1 && sleep 0'
ok: [IOS_VM] => {
    "ansible_facts": {
        "ansible_net_all_ipv4_addresses": [
            "10.1.32.161"
        ],
        "ansible_net_all_ipv6_addresses": [],
        "ansible_net_api": "cliconf",
        "ansible_net_config": "!\n! Last configuration change at 14:29:23 UTC Sat Apr 9 2022\n!\nversion 16.12\nservice timestamps debug datetime msec\nservice timestamps log datetime msec\nservice call-home\nplatform qfp utilization monitor load 80\nplatform punt-keepalive disable-kernel-core\nplatform console virtual\n!\nhostname Virtual_Cisco\n!\nboot-start-marker\nboot-end-marker\n!\n!\nvrf definition LEVEL3\n !\n address-family ipv4\n exit-address-family\n!\nvrf definition LVEL3\n!\nenable secret 9 $9$cGZtYd5MiI74Gk$yxjml53AwJD.42k.Bid.rjTBPATwSOumeNoHZWFTXDg\n!\naaa new-model\n!\n!\naaa authorization exec default local \n!\n!\n!\n!\n!\naaa session-id common\ncall-home\n ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com\n ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications.\n contact-email-addr sch-smart-licensing@cisco.com\n profile \"CiscoTAC-1\"\n  active\n  destination transport-method http\n  no destination transport-method email\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\nlogin on-success log\n!\n!\n!\n!\n!\n!\n!\nsubscriber templating\n! \n! \n! \n! \n!\n!\nmultilink bundle-name authenticated\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\ncrypto pki trustpoint TP-self-signed-1220805708\n enrollment selfsigned\n subject-name cn=IOS-Self-Signed-Certificate-1220805708\n revocation-check none\n rsakeypair TP-self-signed-1220805708\n!\ncrypto pki trustpoint SLA-TrustPoint\n enrollment pkcs12\n revocation-check crl\n!\n!\ncrypto pki certificate chain TP-self-signed-1220805708\n certificate self-signed 01\n  30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 \n  31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 \n  69666963 6174652D 31323230 38303537 3038301E 170D3232 30343038 32323533 \n  31385A17 0D333030 31303130 30303030 305A3031 312F302D 06035504 03132649 \n  4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 32323038 \n  30353730 38308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 \n  0A028201 0100AC78 F5F57BAB 5B183B28 786736BC 8857DF65 4BC56280 580CA4B3 \n  11A7D21F 84A8EF91 D96F27DE F54718CB BD0E4875 25B36E41 9C939093 8D5EFF63 \n  A9798433 18184D27 717B215A A7297026 2D17C791 A23CC776 3D2677C5 AD05ACE5 \n  D3D9EC55 62B5C86A FE3DD718 9ADA9DD1 A0FB2BE8 770FDC35 31FC4242 5370E3C0 \n  5814A901 9638581C 7C49434B ECD22120 52CC7F89 264909D7 005D8755 08031160 \n  A39AD705 570AF7F9 5271F43C 4E286324 952C1CB8 21AED397 097586EF 63747CFC \n  A93537BD 7D631256 D4F9AF40 69E5AED0 FFC3DC04 2AA9E3CE 5AAA502D 8281F9C4 \n  54920D62 9A87ABD9 C6F4FD5B B8AAFF35 93CB58FA 3F81D020 101FB3C8 AD136D8D \n  714ECD13 1BC10203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF \n  301F0603 551D2304 18301680 141668B7 B7CC20C9 72F463FB 9A3ADDDE 4621C508 \n  6B301D06 03551D0E 04160414 1668B7B7 CC20C972 F463FB9A 3ADDDE46 21C5086B \n  300D0609 2A864886 F70D0101 05050003 82010100 91E30B0F D2DADB43 6BF99499 \n  CFC5E81D E554F346 28B6EED2 D2FCA579 2814F2D8 1D94844D DDC7E261 FCA6D1B4 \n  2566B7FE 7267A91D 81B671DC 4F0B2EE1 6BB799DF 765575F0 46A02497 193C82BF \n  B9732033 0719444A F282742B 76490B01 67AC4C4B 0F2ABB24 6008078F 2CD3BEF2 \n  8E447009 B24CDF0B A0EBEE94 50BAA718 30AA0800 F9DDF963 BBA94FBD B9C07321 \n  AFC3A686 36BD0F72 EBEBD298 07038D2A 59B4D89A E0CEB03F 95BC4AF3 D9EC63A0 \n  F6F31196 939331EF F5DD9282 6F725001 F2ED3013 E9E8E9D8 0D97E500 EBC062CE \n  A3C2412B 3989EE80 DCCB9C89 3425FF92 469516E9 D0455AAD 9C0BCEAC FA78F77E \n  5C6D14F4 85FE98EF 2A3B7663 EE224C18 F4CA6BF3\n  \tquit\ncrypto pki certificate chain SLA-TrustPoint\n certificate ca 01\n  30820321 30820209 A0030201 02020101 300D0609 2A864886 F70D0101 0B050030 \n  32310E30 0C060355 040A1305 43697363 6F312030 1E060355 04031317 43697363 \n  6F204C69 63656E73 696E6720 526F6F74 20434130 1E170D31 33303533 30313934 \n  3834375A 170D3338 30353330 31393438 34375A30 32310E30 0C060355 040A1305 \n  43697363 6F312030 1E060355 04031317 43697363 6F204C69 63656E73 696E6720 \n  526F6F74 20434130 82012230 0D06092A 864886F7 0D010101 05000382 010F0030 \n  82010A02 82010100 A6BCBD96 131E05F7 145EA72C 2CD686E6 17222EA1 F1EFF64D \n  CBB4C798 212AA147 C655D8D7 9471380D 8711441E 1AAF071A 9CAE6388 8A38E520 \n  1C394D78 462EF239 C659F715 B98C0A59 5BBB5CBD 0CFEBEA3 700A8BF7 D8F256EE \n  4AA4E80D DB6FD1C9 60B1FD18 FFC69C96 6FA68957 A2617DE7 104FDC5F EA2956AC \n  7390A3EB 2B5436AD C847A2C5 DAB553EB 69A9A535 58E9F3E3 C0BD23CF 58BD7188 \n  68E69491 20F320E7 948E71D7 AE3BCC84 F10684C7 4BC8E00F 539BA42B 42C68BB7 \n  C7479096 B4CB2D62 EA2F505D C7B062A4 6811D95B E8250FC4 5D5D5FB8 8F27D191 \n  C55F0D76 61F9A4CD 3D992327 A8BB03BD 4E6D7069 7CBADF8B DF5F4368 95135E44 \n  DFC7C6CF 04DD7FD1 02030100 01A34230 40300E06 03551D0F 0101FF04 04030201 \n  06300F06 03551D13 0101FF04 05300301 01FF301D 0603551D 0E041604 1449DC85 \n  4B3D31E5 1B3E6A17 606AF333 3D3B4C73 E8300D06 092A8648 86F70D01 010B0500 \n  03820101 00507F24 D3932A66 86025D9F E838AE5C 6D4DF6B0 49631C78 240DA905 \n  604EDCDE FF4FED2B 77FC460E CD636FDB DD44681E 3A5673AB 9093D3B1 6C9E3D8B \n  D98987BF E40CBD9E 1AECA0C2 2189BB5C 8FA85686 CD98B646 5575B146 8DFC66A8 \n  467A3DF4 4D565700 6ADF0F0D CF835015 3C04FF7C 21E878AC 11BA9CD2 55A9232C \n  7CA7B7E6 C1AF74F6 152E99B7 B1FCF9BB E973DE7F 5BDDEB86 C71E3B49 1765308B \n  5FB0DA06 B92AFE7F 494E8A9E 07B85737 F3A58BE1 1A48A229 C37C1E69 39F08678 \n  80DDCD16 D6BACECA EEBC7CF9 8428787B 35202CDC 60E4616A B623CDBD 230E3AFB \n  418616A9 4093E049 4D10AB75 27E86F73 932E35B5 8862FDAE 0275156F 719BB2F0 \n  D697DF7F 28\n  \tquit\n!\ncrypto pki certificate pool\n cabundle nvram:ios_core.p7b\n!\nlicense udi pid CSR1000V sn 9RAN85JRTI8\ndiagnostic bootup level minimal\nmemory free low-watermark processor 72301\n!\n!\nspanning-tree extend system-id\n!\nusername admin privilege 15 secret 9 $9$HHuuWF/L53CeqE$OuaYvXA/IOg7WAbw5z8HXwM.tSOfXLpyJMSvTOglX1E\n!\nredundancy\n!\n!\n!\n!\n!\n!\n! \n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n! \n! \n!\n!\ninterface GigabitEthernet1\n ip dhcp client client-id ascii 9RAN85JRTI8\n ip address dhcp\n negotiation auto\n no mop enabled\n no mop sysid\n!\ninterface GigabitEthernet2\n no ip address\n negotiation auto\n no mop enabled\n no mop sysid\n!\ninterface GigabitEthernet3\n no ip address\n shutdown\n negotiation auto\n no mop enabled\n no mop sysid\n!\nrouter bgp 64860\n bgp router-id 10.238.130.186\n bgp log-neighbor-changes\n neighbor 10.238.130.185 remote-as 1\n neighbor 10.238.130.185 version 4\n neighbor 10.253.0.174 remote-as 64860\n neighbor 10.253.0.174 description US-ALEXANDRIA-1887-SD\n !\n address-family ipv4\n  network 10.238.129.48 mask 255.255.255.252\n  redistribute eigrp 188 route-map BGP_TO_EC\n  neighbor 10.238.130.185 activate\n  neighbor 10.253.0.174 activate\n  neighbor 10.253.0.174 next-hop-self\n  neighbor 10.253.0.174 route-map BGP_TO_EC out\n exit-address-family\n!\nip forward-protocol nd\nip http server\nip http authentication local\nip http secure-server\nip http client source-interface GigabitEthernet1\n!\nip ssh pubkey-chain\n  username admin\n   key-hash ssh-rsa 5B538A484D1E122C975E159A39F033EE \nip ssh server algorithm hostkey ssh-rsa\n!\n!\n!\nip prefix-list DEFAULT seq 5 permit 0.0.0.0/0\n!\n!\nroute-map BGP_TO_EC permit 10 \n match ip address prefix-list DEFAULT\n!\n!\n!\n!\n!\n!\ncontrol-plane\n!\n!\n!\n!\n!\n!\nline con 0\n stopbits 1\nline vty 0 4\n!\n!\n!\n!\n!\n!\nend",
        "ansible_net_filesystems": [
            "bootflash:"
        ],
        "ansible_net_filesystems_info": {
            "bootflash:": {
                "spacefree_kb": 5303912.0,
                "spacetotal_kb": 6139200.0
            }
        },
        "ansible_net_gather_network_resources": [],
        "ansible_net_gather_subset": [
            "config",
            "default",
            "interfaces",
            "hardware"
        ],
        "ansible_net_hostname": "Virtual_Cisco",
        "ansible_net_image": "bootflash:packages.conf",
        "ansible_net_interfaces": {
            "GigabitEthernet1": {
                "bandwidth": 1000000,
                "description": null,
                "duplex": "Full",
                "ipv4": [
                    {
                        "address": "10.1.32.161",
                        "subnet": "22"
                    }
                ],
                "lineprotocol": "up",
                "macaddress": "0800.273f.73dc",
                "mediatype": "Virtual",
                "mtu": 1500,
                "operstatus": "up",
                "type": "CSR vNIC"
            },
            "GigabitEthernet2": {
                "bandwidth": 1000000,
                "description": null,
                "duplex": "Full",
                "ipv4": [],
                "lineprotocol": "up",
                "macaddress": "0800.2760.86b5",
                "mediatype": "Virtual",
                "mtu": 1500,
                "operstatus": "up",
                "type": "CSR vNIC"
            },
            "GigabitEthernet3": {
                "bandwidth": 1000000,
                "description": null,
                "duplex": "Full",
                "ipv4": [],
                "lineprotocol": "down",
                "macaddress": "0800.27c9.eadb",
                "mediatype": "Virtual",
                "mtu": 1500,
                "operstatus": "administratively down",
                "type": "CSR vNIC"
            }
        },
        "ansible_net_iostype": "IOS-XE",
        "ansible_net_memfree_mb": 2048556.390625,
        "ansible_net_memtotal_mb": 2295874.109375,
        "ansible_net_model": "CSR1000V",
        "ansible_net_neighbors": {},
        "ansible_net_python_version": "3.9.7",
        "ansible_net_serialnum": "9RAN85JRTI8",
        "ansible_net_system": "ios",
        "ansible_net_version": "16.12.05",
        "ansible_network_resources": {}
    },
    "changed": false,
    "invocation": {
        "module_args": {
            "available_network_resources": false,
            "gather_network_resources": null,
            "gather_subset": [
                "all"
            ],
            "provider": null
        }
    }
}

TASK [Gather existing running Config] ************************************************************************************************************************************************
task path: /home/share/ansible/ios_config_routemap_parse.yml:15
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<10.1.32.161> ESTABLISH LOCAL CONNECTION FOR USER: <SOME USERNAME>
<10.1.32.161> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx `"&& mkdir "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291 `" && echo ansible-tmp-1649516630.7113237-1719-98750512057291="` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291 `" ) && sleep 0'
Using module file /home/<SOME USERNAME>/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_command.py
<10.1.32.161> PUT /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/tmp3ox12v2z TO /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291/AnsiballZ_ios_command.py
<10.1.32.161> EXEC /bin/sh -c 'chmod u+x /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291/ /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291/AnsiballZ_ios_command.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c '/usr/bin/python3 /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291/AnsiballZ_ios_command.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c 'rm -f -r /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516630.7113237-1719-98750512057291/ > /dev/null 2>&1 && sleep 0'
ok: [IOS_VM] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "commands": [
                {
                    "answer": null,
                    "check_all": false,
                    "command": "sh running-config | section ^route-map",
                    "newline": true,
                    "output": null,
                    "prompt": null,
                    "sendonly": false
                }
            ],
            "interval": 1,
            "match": "all",
            "provider": null,
            "retries": 10,
            "wait_for": null
        }
    },
    "stdout": [
        "route-map BGP_TO_EC permit 10 \n match ip address prefix-list DEFAULT"
    ],
    "stdout_lines": [
        [
            "route-map BGP_TO_EC permit 10 ",
            " match ip address prefix-list DEFAULT"
        ]
    ]
}

TASK [display intput for parser task] ************************************************************************************************************************************************
task path: /home/share/ansible/ios_config_routemap_parse.yml:21
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
ok: [IOS_VM] => {
    "running_route_map.stdout[0]": "route-map BGP_TO_EC permit 10 \n match ip address prefix-list DEFAULT"
}

TASK [parse existing Global BGP Config] **********************************************************************************************************************************************
task path: /home/share/ansible/ios_config_routemap_parse.yml:25
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<10.1.32.161> ESTABLISH LOCAL CONNECTION FOR USER: <SOME USERNAME>
<10.1.32.161> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx `"&& mkdir "` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370 `" && echo ansible-tmp-1649516632.3955762-1746-230066240119370="` echo /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370 `" ) && sleep 0'
Using module file /home/<SOME USERNAME>/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_route_maps.py
<10.1.32.161> PUT /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/tmpaxs2uir1 TO /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370/AnsiballZ_ios_route_maps.py
<10.1.32.161> EXEC /bin/sh -c 'chmod u+x /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370/ /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370/AnsiballZ_ios_route_maps.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c '/usr/bin/python3 /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370/AnsiballZ_ios_route_maps.py && sleep 0'
<10.1.32.161> EXEC /bin/sh -c 'rm -f -r /home/<SOME USERNAME>/.ansible/tmp/ansible-local-1654ypllgyfx/ansible-tmp-1649516632.3955762-1746-230066240119370/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_ios_route_maps_payload_ulnhg537/ansible_ios_route_maps_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py", line 133, in get_network_resources_facts
    inst.populate_facts(
  File "/tmp/ansible_ios_route_maps_payload_ulnhg537/ansible_ios_route_maps_payload.zip/ansible_collections/cisco/ios/plugins/module_utils/network/ios/facts/route_maps/route_maps.py", line 68, in populate_facts
    objs = route_maps_parser.parse()
  File "/tmp/ansible_ios_route_maps_payload_ulnhg537/ansible_ios_route_maps_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/rm_base/network_template.py", line 102, in parse
    res = self._deepformat(deepcopy(parser["result"]), vals)
  File "/tmp/ansible_ios_route_maps_payload_ulnhg537/ansible_ios_route_maps_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/rm_base/network_template.py", line 74, in _deepformat
    ftkey = self._template(tkey, data)
  File "/tmp/ansible_ios_route_maps_payload_ulnhg537/ansible_ios_route_maps_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py", line 738, in __call__
    value = self.env.from_string(value).render(variables)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
fatal: [IOS_VM]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config": null,
            "running_config": "route-map BGP_TO_EC permit 10 \n match ip address prefix-list DEFAULT",
            "state": "parsed"
        }
    },
    "msg": "'route_map' is undefined"
}

PLAY RECAP *******************************************************************************************************************************
KB-perByte commented 2 years ago

Hey, @nspitzer I tried reproducing it on my end I faced some other issues with the play you shared. Recommendations would be you should be able to use the gathered state to build the source of truth in the context of reusing it within another task, it would save you dealing with command modules in this use case, and the last task you must feed structured data to config rather than running_config. Please consider checking the issues with he change suggested. But, as per the reported issue, the task with the parsed state gives no exception at my end. Regards

KB-perByte commented 2 years ago

and, can you please share the jinja2 version you are using?

KB-perByte commented 2 years ago

@nspitzer Closing this issue as there is no activity here

netexgb commented 2 years ago

Dear @KB-perByte, Although @nspitzer has not replied to you, I actually have the same issue. The Playbook I am trying to run is as follows:

After running the playbook and debugging, I got the following output:

fatal: [test]: FAILED! => { "changed": false, "invocation": { "module_args": { "config": [ { "entries": [ { "action": "deny", "continue_entry": null, "description": "Deny the default route to the CSPs", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "DEFAULT-ROUTE" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 10, "set": null }, { "action": "permit", "continue_entry": null, "description": "Match NAM Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "NAM_SUMMARY_ROUTES", "USA-Colocation-Subnets" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 20, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match SAM Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "SAM_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 21, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match ASA Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "ASA_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 30, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match EAF Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "EAF_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 31, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match MEA Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "MEA_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 32, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match Anycast and General Summaries and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "GLOBAL_SUMMARY_ROUTES", "ANYCAST-DNS-SUMMARIES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 50, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "deny", "continue_entry": null, "description": "Deny any non-previous matching traffic", "match": null, "sequence": 100, "set": null } ], "route_map": "TO_TRANSIT_CLOUD_GENERAL" } ], "running_config": null, "state": "replaced" } }, "msg": "'route_map' is undefined" }

I am running Ansible version 6.0 and the cisco.ios version is 3.2.0

ansible [core 2.13.1] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/gbloise/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/gbloise/.local/lib/python3.8/site-packages/ansible ansible collection location = /home/gbloise/.ansible/collections executable location = /home/gbloise/.local/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True

/home/gbloise/.local/lib/python3.8/site-packages/ansible_collections

Collection Version


cisco.ios 3.0.0

/home/gbloise/.ansible/collections/ansible_collections

Collection Version


cisco.ios 3.2.0

KB-perByte commented 2 years ago

Dear @KB-perByte, Although @nspitzer has not replied to you, I actually have the same issue. The Playbook I am trying to run is as follows:

  • name: Route Map TO_TRANSIT_CLOUD_GENERAL Configuration hosts: cloudrouters gather_facts: false

    tasks:

    • name: TO_TRANSIT_CLOUD_GENERAL Configuration when: inventory_hostname == "test" cisco.ios.ios_route_maps: config:
      • route_map: TO_TRANSIT_CLOUD_GENERAL entries:
        • sequence: 10 action: deny description: Deny the default route to the CSPs match: ip: address: prefix_lists:
          • DEFAULT-ROUTE
        • sequence: 20 action: permit description: Match NAM Summary routes and set AS_PATH x 1 match: ip: address: prefix_lists:
          • NAM_SUMMARY_ROUTES
          • USA-Colocation-Subnets set: metric: metric_value: 1 as_path: prepend: last_as: 1
        • sequence: 21 action: permit description: Match SAM Summary routes and set AS_PATH x 1 match: ip: address: prefix_lists:
          • SAM_SUMMARY_ROUTES set: metric: metric_value: 1 as_path: prepend: last_as: 1
        • sequence: 30 action: permit description: Match ASA Summary routes and set AS_PATH x 1 match: ip: address: prefix_lists:
          • ASA_SUMMARY_ROUTES set: metric: metric_value: 234 as_path: prepend: last_as: 1
        • sequence: 31 action: permit description: Match EAF Summary routes and set AS_PATH x 1 match: ip: address: prefix_lists:
          • EAF_SUMMARY_ROUTES set: metric: metric_value: 234 as_path: prepend: last_as: 1
        • sequence: 32 action: permit description: Match MEA Summary routes and set AS_PATH x 1 match: ip: address: prefix_lists:
          • MEA_SUMMARY_ROUTES set: metric: metric_value: 234 as_path: prepend: last_as: 1
        • sequence: 50 action: permit description: Match Anycast and General Summaries and set AS_PATH x 1 match: ip: address: prefix_lists:
          • GLOBAL_SUMMARY_ROUTES
          • ANYCAST-DNS-SUMMARIES set: metric: metric_value: 1 as_path: prepend: last_as: 1
        • sequence: 100 action: deny description: Deny any non-previous matching traffic state: replaced

After running the playbook and debugging, I got the following output:

fatal: [test]: FAILED! => { "changed": false, "invocation": { "module_args": { "config": [ { "entries": [ { "action": "deny", "continue_entry": null, "description": "Deny the default route to the CSPs", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "DEFAULT-ROUTE" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 10, "set": null }, { "action": "permit", "continue_entry": null, "description": "Match NAM Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "NAM_SUMMARY_ROUTES", "USA-Colocation-Subnets" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 20, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match SAM Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "SAM_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 21, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match ASA Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "ASA_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 30, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match EAF Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "EAF_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 31, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match MEA Summary routes and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "MEA_SUMMARY_ROUTES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 32, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 234, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "permit", "continue_entry": null, "description": "Match Anycast and General Summaries and set AS_PATH x 1", "match": { "additional_paths": null, "as_path": null, "clns": null, "community": null, "extcommunity": null, "interfaces": null, "ip": { "address": { "acls": null, "prefix_lists": [ "GLOBAL_SUMMARY_ROUTES", "ANYCAST-DNS-SUMMARIES" ] }, "flowspec": null, "next_hop": null, "redistribution_source": null, "route_source": null }, "ipv6": null, "length": null, "local_preference": null, "mdt_group": null, "metric": null, "mpls_label": null, "policy_lists": null, "route_type": null, "rpki": null, "security_group": null, "source_protocol": null, "tag": null, "track": null }, "sequence": 50, "set": { "aigp_metric": null, "as_path": { "prepend": { "as_number": null, "last_as": 1 }, "tag": null }, "automatic_tag": null, "clns": null, "comm_list": null, "community": null, "dampening": null, "default": null, "extcomm_list": null, "extcommunity": null, "global_route": null, "interfaces": null, "ip": null, "ipv6": null, "level": null, "lisp": null, "local_preference": null, "metric": { "deviation": null, "eigrp_delay": null, "metric_bandwidth": null, "metric_reliability": null, "metric_value": 1, "mtu": null }, "metric_type": null, "mpls_label": null, "origin": null, "tag": null, "traffic_index": null, "vrf": null, "weight": null } }, { "action": "deny", "continue_entry": null, "description": "Deny any non-previous matching traffic", "match": null, "sequence": 100, "set": null } ], "route_map": "TO_TRANSIT_CLOUD_GENERAL" } ], "running_config": null, "state": "replaced" } }, "msg": "'route_map' is undefined" }

I am running Ansible version 6.0 and the cisco.ios version is 3.2.0

ansible [core 2.13.1] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/gbloise/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/gbloise/.local/lib/python3.8/site-packages/ansible ansible collection location = /home/gbloise/.ansible/collections executable location = /home/gbloise/.local/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True

/home/gbloise/.local/lib/python3.8/site-packages/ansible_collections

Collection Version


cisco.ios 3.0.0

/home/gbloise/.ansible/collections/ansible_collections

Collection Version


cisco.ios 3.2.0

Hey @netexgb thanks for the details I'll look into it would you please raise a separate issue with the details you shared. Thank you.

netexgb commented 2 years ago

Hi @KB-perByte, Thanks for your reply. I opened a new case, its number is #618 .. Please let me know if anything else is required :) Regards, Gian