Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing BGP neighbor passwords definitions and VRF bgp send-community no longer errors #482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jakegroves
Copy link

SUMMARY

Parsing BGP neighbor passwords will not error on the type. As nolog only enabled for password and not the type
Parsing BGP neighbor in VRFs no longer errors when send-community is set without any attributes

Fixes #467

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

eos_bgp_global

ADDITIONAL INFORMATION

Example playbook

- hosts: all
  connection: network_cli
  gather_facts: no

  tasks:
    - name: Gather configuration
      arista.eos.eos_facts:
        gather_subset:
          - config

    - name: Gather BGP Info
      arista.eos.eos_bgp_global:
        state: gathered
        running_config: "{{ ansible_net_config }}"
      register: eos_bgp

    - name: Render BGP info
      arista.eos.eos_bgp_global:
        state: rendered
        config: "{{ eos_bgp.gathered }}"
      register: eos_bgp_rendered

Error with send community for vrf bgp neighbor:

TASK [Render BGP info] ******************************************************************************************************************************************************************************************************************************
fatal: [router-02.domain]: FAILED! => {
    "changed": false
}

MSG:

Unsupported parameters for (basic.py) module: config.vrfs.neighbor.send_community.set. Supported parameters include: state, config, running_config.

PLAY RECAP ******************************************************************************************************************************************************************************************************************************************
router-02.domain : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Error with encryption password parsing on type

TASK [Render BGP info] ******************************************************************************************************************************************************************************************************************************
fatal: [router-02.domain]: FAILED! => {
    "changed": false
}

MSG:

argument 'type' is of type <class 'ansible.utils.unsafe_proxy.AnsibleUnsafeText'> found in 'config -> vrfs -> neighbor -> encryption_password'. and we were unable to convert to int: <class 'ansible.utils.unsafe_proxy.AnsibleUnsafeText'> cannot be converted to an int

PLAY RECAP ******************************************************************************************************************************************************************************************************************************************
router-02.domain : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

After fixes:

PLAY [all] ******************************************************************************************************************************************************************************************************************************************

TASK [Gather configuration] *************************************************************************************************************************************************************************************************************************
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
ok: [router-02.domain]

TASK [Gather BGP Info] ******************************************************************************************************************************************************************************************************************************
[WARNING]: Both option neighbor_address and its alias peer are set.
ok: [router-02.domain]

TASK [Render BGP info] ******************************************************************************************************************************************************************************************************************************
ok: [router-02.domain]

TASK [foobar] ***************************************************************************************************************************************************************************************************************************************
ok: [router-02.domain] => {}

MSG:

{'as_number': '65000', 'vrfs': [{'vrf': 'clean', 'router_id': '10.0.0.19', 'neighbor': [{'neighbor_address': '10.0.0.18', 'remote_as': '65000', 'next_hop_self': True, 'description': 'router-01', 'route_map': {'name': 'Outbound', 'direction': 'out'}}]}, {'vrf': 'dirty', 'neighbor': [{'neighbor_address': '10.0.1.191', 'remote_as': '65000', 'bfd': 'enable', 'description': 'upstream-router02', 'route_map': {'name': 'Outbound', 'direction': 'out'}, 'encryption_password': {'type': 7, 'password': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER'}, 'peer': '10.0.1.191', 'send_community': {'set': True}, 'maximum_received_routes': {'count': 0}}]}], 'distance': {'external': 20, 'internal': 200, 'local': 200}}

…nly enabled for password and not the type

Parsing BGP neighbor in VRFs no longer errors when send-community is set without any attributes
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8fc41fc) 82.75% compared to head (2fcc223) 82.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #482   +/-   ##
=======================================
  Coverage   82.75%   82.75%           
=======================================
  Files         153      153           
  Lines       11967    11967           
=======================================
  Hits         9903     9903           
  Misses       2064     2064           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/bcac1884b23748b585243958c0aafc40

✔️ ansible-test-network-integration-eos-httpapi-python39-stable215 SUCCESS in 46m 13s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 46m 48s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 41m 54s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 41m 36s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 41m 20s
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 37m 06s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 39m 23s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 38m 28s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 34m 12s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 39m 02s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 34m 16s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 39m 01s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 40m 39s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 31m 29s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 33m 06s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 38m 30s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 33m 12s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 37m 24s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 33m 25s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 38m 02s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 33m 35s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 38m 13s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 33m 09s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 38m 28s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 33m 10s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 57s
✔️ ansible-tox-linters SUCCESS in 14m 44s
✔️ ansible-galaxy-importer SUCCESS in 4m 56s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling send-community on BGP peers with no additional arguments fails
2 participants