Skip to content

Commit

Permalink
Merge branch 'aristanetworks:devel' into bgp_peer_ip_use_validation
Browse files Browse the repository at this point in the history
  • Loading branch information
laxmikantchintakindi committed Jun 6, 2024
2 parents 3141317 + 3b630d0 commit 3b2d4c0
Show file tree
Hide file tree
Showing 16 changed files with 296 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autoupdate_commit_msg: "Bump: pre-commit autoupdate"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ interface Management1

### Patch Panel Summary

Patch Panel Connector Interface Recovery Review Delay Min: 10

Patch Panel Connector Interface Recovery Review Delay Max: 900

Patch Panel Connector Interface Path BGP VPWS Remote Failure Errdisable is enabled.

#### Patch Panel Connections

| Patch Name | Enabled | Connector A Type | Connector A Endpoint | Connector B Type | Connector B Endpoint |
| ---------- | ------- | ---------------- | -------------------- | ---------------- | -------------------- |
| TEN_B_site2_site5_eline | True | Interface | Ethernet5 | Pseudowire | bgp vpws TENANT_A pseudowire TEN_B_site2_site5_eline |
Expand All @@ -50,6 +58,9 @@ interface Management1
```eos
!
patch panel
connector interface recovery review delay 10 900
connector interface patch bgp vpws remote-failure errdisable
!
patch TEN_B_site2_site5_eline
connector 1 interface Ethernet5
connector 2 pseudowire bgp vpws TENANT_A pseudowire TEN_B_site2_site5_eline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ interface Management1
ip address 10.73.255.122/24
!
patch panel
connector interface recovery review delay 10 900
connector interface patch bgp vpws remote-failure errdisable
!
patch TEN_B_site2_site5_eline
connector 1 interface Ethernet5
connector 2 pseudowire bgp vpws TENANT_A pseudowire TEN_B_site2_site5_eline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
patch_panel:
connector:
interface:
patch:
bgp_vpws_remote_failure_errdisable: true
recovery:
review_delay:
min: 10
max: 900
patches:
- name: TEN_B_site2_site5_eline
connectors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,8 @@ mpls ldp

### Patch Panel Summary

#### Patch Panel Connections

| Patch Name | Enabled | Connector A Type | Connector A Endpoint | Connector B Type | Connector B Endpoint |
| ---------- | ------- | ---------------- | -------------------- | ---------------- | -------------------- |
| TEN_A_site2_site5_eline_port_based | True | Interface | Ethernet6 | Pseudowire | bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline_port_based |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ mpls ldp

### Patch Panel Summary

#### Patch Panel Connections

| Patch Name | Enabled | Connector A Type | Connector A Endpoint | Connector B Type | Connector B Endpoint |
| ---------- | ------- | ---------------- | -------------------- | ---------------- | -------------------- |
| TEN_B_site3_site5_eline_vlan_based_1000 | True | Interface | Port-Channel3.1000 | Pseudowire | bgp vpws TENANT_B pseudowire TEN_B_site3_site5_eline_vlan_based_1000 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,8 @@ mpls ldp

### Patch Panel Summary

#### Patch Panel Connections

| Patch Name | Enabled | Connector A Type | Connector A Endpoint | Connector B Type | Connector B Endpoint |
| ---------- | ------- | ---------------- | -------------------- | ---------------- | -------------------- |
| TEN_A_site2_site5_eline_port_based | True | Interface | Ethernet7 | Pseudowire | bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline_port_based |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,21 @@ def __init__(self, name: str, connection: ConnectionBase, tags: list | None = No

super().__init__(name, tags, disable_cache=False)
self.check_mode = check_mode

# Check the ansible connection is defined
if not self.check_mode and not hasattr(connection, "_sub_plugin"):
raise AristaAvdError(
message="AVD could not determine the Ansible connection plugin used. "
"Please ensure that the 'ansible_network_os' and 'ansible_connection' variables are set to 'eos' and 'httpapi' respectively for this host."
)
# In check_mode we don't care that we cannot connect to the device
if self.check_mode or (plugin_name := connection._sub_plugin.get("name")) == ANSIBLE_EOS_PLUGIN_NAME:
self._connection = connection
else:
raise AristaAvdError(message=f"The provided Ansible connection does not use EOS HttpApi plugin: {plugin_name}")
raise AristaAvdError(
message=f"The provided Ansible connection does not use EOS HttpApi plugin: {plugin_name}. "
"Please ensure that the 'ansible_network_os' and 'ansible_connection' variables are set to 'eos' and 'httpapi' respectively for this host."
)

@property
def _keys(self) -> tuple:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>patch_panel</samp>](## "patch_panel") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;connector</samp>](## "patch_panel.connector") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;interface</samp>](## "patch_panel.connector.interface") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;patch</samp>](## "patch_panel.connector.interface.patch") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgp_vpws_remote_failure_errdisable</samp>](## "patch_panel.connector.interface.patch.bgp_vpws_remote_failure_errdisable") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recovery</samp>](## "patch_panel.connector.interface.recovery") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;review_delay</samp>](## "patch_panel.connector.interface.recovery.review_delay") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;min</samp>](## "patch_panel.connector.interface.recovery.review_delay.min") | Integer | Required | | Min: 10 | Minimum delay (10-600). |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max</samp>](## "patch_panel.connector.interface.recovery.review_delay.max") | Integer | Required | | Min: 15 | Maximum delay (15-900). |
| [<samp>&nbsp;&nbsp;patches</samp>](## "patch_panel.patches") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "patch_panel.patches.[].name") | String | Required, Unique | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled</samp>](## "patch_panel.patches.[].enabled") | Boolean | | | | |
Expand All @@ -20,6 +28,18 @@

```yaml
patch_panel:
connector:
interface:
patch:
bgp_vpws_remote_failure_errdisable: <bool>
recovery:
review_delay:

# Minimum delay (10-600).
min: <int; >=10; required>

# Maximum delay (15-900).
max: <int; >=15; required>
patches:
- name: <str; required; unique>
enabled: <bool>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,42 @@ keys:
patch_panel:
type: dict
keys:
connector:
type: dict
keys:
interface:
type: dict
keys:
patch:
type: dict
keys:
bgp_vpws_remote_failure_errdisable:
type: bool
recovery:
type: dict
keys:
review_delay:
type: dict
keys:
min:
type: int
required: true
min: 10
convert_types:
- str
description: Minimum delay (10-600).
max:
type: int
required: true
min: 15
convert_types:
- str
description: Maximum delay (15-900).
patches:
type: list
primary_key: name
convert_types:
- dict
- dict
items:
type: dict
keys:
Expand All @@ -25,7 +56,7 @@ keys:
type: list
primary_key: id
convert_types:
- dict
- dict
min_length: 2
max_length: 2
description: Must have exactly two connectors to a patch of which at least one must be of type "interface".
Expand All @@ -35,12 +66,12 @@ keys:
id:
type: str
convert_types:
- int
- int
type:
type: str
valid_values:
- interface
- pseudowire
- interface
- pseudowire
required: true
endpoint:
type: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
## Patch Panel

### Patch Panel Summary
{% if patch_panel.connector.interface.recovery.review_delay.min is arista.avd.defined %}

Patch Panel Connector Interface Recovery Review Delay Min: {{ patch_panel.connector.interface.recovery.review_delay.min }}
{% endif %}
{% if patch_panel.connector.interface.recovery.review_delay.max is arista.avd.defined %}

Patch Panel Connector Interface Recovery Review Delay Max: {{ patch_panel.connector.interface.recovery.review_delay.max }}
{% endif %}
{% if patch_panel.connector.interface.patch.bgp_vpws_remote_failure_errdisable is arista.avd.defined(true) %}

Patch Panel Connector Interface Path BGP VPWS Remote Failure Errdisable is enabled.
{% endif %}

#### Patch Panel Connections

| Patch Name | Enabled | Connector A Type | Connector A Endpoint | Connector B Type | Connector B Endpoint |
| ---------- | ------- | ---------------- | -------------------- | ---------------- | -------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
{% if patch_panel is arista.avd.defined %}
!
patch panel
{% if patch_panel.connector.interface is arista.avd.defined %}
{% if patch_panel.connector.interface.recovery.review_delay.min is arista.avd.defined and patch_panel.connector.interface.recovery.review_delay.max is arista.avd.defined %}
connector interface recovery review delay {{ patch_panel.connector.interface.recovery.review_delay.min }} {{ patch_panel.connector.interface.recovery.review_delay.max }}
{% endif %}
{% if patch_panel.connector.interface.patch.bgp_vpws_remote_failure_errdisable is arista.avd.defined(true) %}
connector interface patch bgp vpws remote-failure errdisable
{% endif %}
!
{% endif %}
{% for patch in patch_panel.patches | arista.avd.default([]) %}
{% if patch.name is arista.avd.defined %}
patch {{ patch.name }}
Expand Down
Loading

0 comments on commit 3b2d4c0

Please sign in to comment.