ansible-collections / cisco.ios

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

cisco.ios.ios_bgp prefix_list_in/prefix_list_out failed #240

Closed fakrul closed 3 years ago

fakrul commented 3 years ago
SUMMARY

Ansible script failed while adding "prefix_list_in" or "prefix_list_out " under BGP neighbour.

ISSUE TYPE
COMPONENT NAME

cisco.ios.ios_bgp

ANSIBLE VERSION
ansible 2.9.17
  config file = /home/fakrul/nac_ansible/ansible.cfg
  configured module search path = [u'/home/fakrul/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]
CONFIGURATION
COMMAND_WARNINGS(/home/fakrul/nac_ansible/ansible.cfg) = False
DEFAULT_HOST_LIST(/home/fakrul/nac_ansible/ansible.cfg) = [u'/home/fakrul/nac_ansible/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/fakrul/nac_ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/home/fakrul/nac_ansible/ansible.cfg) = /home/fakrul/nac_ansible/ansible.log
DEFAULT_STDOUT_CALLBACK(/home/fakrul/nac_ansible/ansible.cfg) = yaml
DEFAULT_TIMEOUT(/home/fakrul/nac_ansible/ansible.cfg) = 5
DEPRECATION_WARNINGS(/home/fakrul/nac_ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/home/fakrul/nac_ansible/ansible.cfg) = False
SYSTEM_WARNINGS(/home/fakrul/nac_ansible/ansible.cfg) = False
OS / ENVIRONMENT

router-test>show version Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.6(1)T, RELEASE SOFTWARE (fc1)

STEPS TO REPRODUCE
---
- hosts: routers-test
  gather_facts: no
  vars_files:
    - "../secrets/vault.yml"

  tasks:
  - name: configure bgp - ebgp v4 peers
    ios_bgp:
      config:
        bgp_as: 64496
        log_neighbor_changes: True
        router_id: 100.100.100.250
        neighbors:
        - neighbor: 100.100.250.1
          remote_as: 65534
          description: TEST NETWORK
          prefix_list_in: AS65534_IN
          prefix_list_out: AS65534_OUT
        networks:
        - prefix: 192.0.2.0
          masklen: 23
      operation: override
    tags:
    - bgp
EXPECTED RESULTS

Name of ip prefix-list "AS65534_IN" or "AS65534_OUT" apply to incoming or outgoing prefix-list for the neighbor 100.100.250.1

ACTUAL RESULTS

Script failed with following output:

TASK [configure bgp - ebgp v4 peers] *********************************************************************************************************************************************
task path: /home/fakrul/nac_ansible/temp_scripts/bgp_test.yml:8
<100.100.250.250> ESTABLISH LOCAL CONNECTION FOR USER: fakrul
<100.100.250.250> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM `"&& mkdir "` echo /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026 `" && echo ansible-tmp-1612300607.75-14060-25235925925026="` echo /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026 `" ) && sleep 0'
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_bgp.py
<100.100.250.250> PUT /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/tmp6MWM5y TO /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026/AnsiballZ_ios_bgp.py
<100.100.250.250> EXEC /bin/sh -c 'chmod u+x /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026/ /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026/AnsiballZ_ios_bgp.py && sleep 0'
<100.100.250.250> EXEC /bin/sh -c 'python3 /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026/AnsiballZ_ios_bgp.py && sleep 0'
<100.100.250.250> EXEC /bin/sh -c 'rm -f -r /home/fakrul/.ansible/tmp/ansible-local-14053Q8K7mM/ansible-tmp-1612300607.75-14060-25235925925026/ > /dev/null 2>&1 && sleep 0'
fatal: [router-test]: FAILED! => changed=false
  invocation:
    module_args:
      config:
        address_family: null
        bgp_as: 64496
        log_neighbor_changes: true
        neighbors:
        - description: TEST NETWORK
          neighbor: 100.100.250.1
          prefix_list_in: AS65534_IN
          prefix_list_out: AS65534_OUT
          remote_as: 65534
        networks:
        - masklen: 23
          prefix: 192.0.2.0
        router_id: 100.100.100.250
      operation: override
  msg: 'Unsupported parameters for (ios_bgp) module: prefix_list_in, prefix_list_out found in config -> neighbors. Supported parameters include: description, ebgp_multihop, enabled, local_as, neighbor, password, peer_group, remote_as, timers, update_source'
justjais commented 3 years ago

@fakrul Thanks for logging the issue, but for prefix_list_in n prefix_list_out parent key is neighbor which and is valid for address_family context. Also, we've introduced a new BGP global resource module with IOS collection Jan release with more functionality and use case support n we'll be adding the BGP address family resource module with the Feb release and we would highly recommend to use the newer resource module instead.