cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1555
Views
0
Helpful
2
Replies

Issue with cisco.ios.ios_route_maps ansible module

Nathan Spitzer
Level 1
Level 1

I am trying to deploy the following configuration to some routers using Ansible:

 

route-map BGP_TO_EC permit 10
match ip address prefix-list DEFAULT

 

As far as I can tell from the documentation this should be the correct YAML:

 

 - name: create/verify route map
      cisco.ios.ios_route_maps:
        config:
          - route_map: BGP_TO_EC
            entries: 
            - sequence: 10
              action: permit
              match:
                ip:
                  address:
                    prefix_lists:
                      - DEFAULT

 

However when I try to run that I get an error:

"msg": "'route_map' is undefined"

 

I would normally believe I just messed up except I attempted to parse the above valid configuration and that also fails with the same error. I have attached my test file and test playbook and the full error message from a test run.

 

I am using cisco.ios version 2.8.1, ansible  version  2.10.8

 

If anyone has any ideas it would be greatly appreciated.

 

2 Replies 2

Nathan Spitzer
Level 1
Level 1

Update - to verify this was not a PEBKAC issue I did the following:

1) spun up a VM router and applied the desired configuration

2) Created a playbook that had the following tasks:

  1. Grabbed the current running configuration
  2. Filtered the config from above using the filter specified in  cisco.ios.route_maps running_config  parameter
  3. Used the filtered running config from step 2 as running_config to have cisco.ios.route_maps parse.

Using the steps above I guaranteed I was feeding a correct config to the parser and this also failed with same message. I have included complete log of the playbook below:

 

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!\**bleep** forward-protocol nd\**bleep** http server\**bleep** http authentication local\**bleep** http secure-server\**bleep** http client source-interface GigabitEthernet1\n!\**bleep** ssh pubkey-chain\n username admin\n key-hash ssh-rsa 5B538A484D1E122C975E159A39F033EE \**bleep** ssh server algorithm hostkey ssh-rsa\n!\n!\n!\**bleep** 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 ************************************************************************************************************************************

gbloise
Level 1
Level 1

Hi Nathan,

Are you still having this problem? You also had a case opened in github, without resolution. Were you able to solve it?

Regards,

Gian

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: