-
Notifications
You must be signed in to change notification settings - Fork 257
Feat(eos_designs, eos_cli_config_gen): Added the support to enable or disable bgp peer validation in vrf #6071
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
base: devel
Are you sure you want to change the base?
Conversation
… disable bgp peer validation in vrf
|
Review docs on Read the Docs To test this pull request: # Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-6071
# Activate the virtual environment
source test-avd-pr-6071/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/MaheshGSLAB/ansible-avd.git@bgp-peer-validation#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/MaheshGSLAB/ansible-avd.git#/ansible_collections/arista/avd/,bgp-peer-validation --force
# Optional: Install AVD examples
cd test-avd-pr-6071
ansible-playbook arista.avd.install_examples |
| mlag_peer=self.shared_utils.mlag_peer, | ||
| interface=interface_name, | ||
| peer_interface=interface_name, | ||
| if isinstance(bgp_vrf, EosCliConfigGen.RouterBgp.VrfsItem): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you are doing this for type checking - lets do this in another PR (and think if can find a better way as this looks like a lot of code suddenly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way i can see is using the obtain method which dont require much if else for type check also not much complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont' need obtain cf suggestions
|
| bgp_vrf.neighbor_interfaces.append_new( | ||
| name=interface_name, | ||
| peer_group=self.shared_utils.mlag_vrfs_peer_group_name, | ||
| remote_as=self.shared_utils.formatted_bgp_as, | ||
| description=AvdStringFormatter().format( | ||
| self.inputs.mlag_bgp_peer_description, | ||
| mlag_peer=self.shared_utils.mlag_peer, | ||
| interface=interface_name, | ||
| peer_interface=interface_name, | ||
| ) | ||
| or None, | ||
| ) | ||
| bgp_vrf.neighbor_interfaces.obtain(interface_name).metadata.validate_state = vrf.validate_bgp_peers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bgp_vrf.neighbor_interfaces.obtain(interface_name).metadata.validate_state = vrf.validate_bgp_peers | |
| neighbor_interface = bgp_vrf.neighbor_interfaces.append_new( | |
| name=interface_name, | |
| peer_group=self.shared_utils.mlag_vrfs_peer_group_name, | |
| remote_as=self.shared_utils.formatted_bgp_as, | |
| description=AvdStringFormatter().format( | |
| self.inputs.mlag_bgp_peer_description, | |
| mlag_peer=self.shared_utils.mlag_peer, | |
| interface=interface_name, | |
| peer_interface=interface_name, | |
| ) | |
| or None, | |
| ) | |
| neighbor_interface.metadata.validate_state = vrf.validate_bgp_peers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the diff is messed up but you get the gist (thanks Github UI...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjust code to use the return value from append_new



Change Summary
Added the support to enable or disable bgp peer validation in vrf
Related Issue(s)
Fixes #
Component(s) name
arista.avd.eos_designsProposed changes
Introduce a knob to enable or disable BGP peer state validation on a per-VRF basis.
eos_designs Additions:
eos_cli_config_gen Additions:
How to test
Run molecule
Checklist
User Checklist
Repository Checklist