Skip to content

Commit

Permalink
Merge branch 'devel' into mpls_tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Jul 19, 2024
2 parents fd1e175 + 2050930 commit 643fa51
Show file tree
Hide file tree
Showing 65 changed files with 778 additions and 208 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ repos:
name: Build documentation for collection filter plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Filter_plugins/"
language: python
types: [python]
types_or: [python, yaml]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
files: ansible_collections/arista/avd/plugins/filter/
exclude: ^(ansible_collections/arista/avd/plugins/filter/deprecated_filters.py)$

- id: docs-plugin-lookup
name: Build documentation for collection lookup plugins.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
398 changes: 398 additions & 0 deletions ansible_collections/arista/avd/docs/getting-started/avd-aap.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# This title is used for search results
title: arista.avd._emit_warning
---
<!--
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->

# _emit_warning

!!! note
Always use the FQCN (Fully Qualified Collection Name) `arista.avd._emit_warning` when using this plugin.

Internal module - DO NOT USE - Emit a warning in a task.

## Synopsis

Emit a warning in a task.

## Parameters

| Argument | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| <samp>message</samp> | str | optional | None | | The warning message to emit. |

## Examples

```yaml
---
- name: Emit a warning
arista.avd._emit_warning:
message |-
The warning message.
delegate_to: localhost
check_mode: false
run_once: true
changed_when: false
```
## Authors
- Arista Networks (@aristanetworks)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# This title is used for search results
title: arista.avd.emit_warning
---
<!--
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->

# emit_warning

!!! note
Always use the FQCN (Fully Qualified Collection Name) `arista.avd.emit_warning` when using this plugin.

Emit a warning in a task.

## Synopsis

Emit a warning in a task.

## Parameters

| Argument | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| <samp>message</samp> | str | optional | None | | The warning message to emit. |

## Examples

```yaml
---
- name: Enit a warning
arista.avd.emit_warning:
message |-
The warning message.
delegate_to: localhost
check_mode: false
run_once: true
changed_when: false
```
## Authors
- EMEA AS Team (@aristanetworks)
10 changes: 9 additions & 1 deletion ansible_collections/arista/avd/docs/release-notes/4.x.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ title: Release Notes for AVD 4.x.x

- Documentation for AVD version `4.x.x` [available here](https://www.avd.sh/en/stable/)

<!-- Release notes generated using configuration in .github/release.yml at devel -->
## Release 4.10.0

### Deprecations

- In AVD version 5.0.0, the `eos_designs.jsonschema.json` and `eos_cli_config_gen.jsonschema.json` will no longer be generated. These schemas are not being used and have never been complete.

## Release 4.9.0

### Breaking or behavioral changes in eos_designs
Expand Down Expand Up @@ -56,6 +61,9 @@ Pull request:
- `arista.avd.validate_and_template`
- `arista.avd.yaml_templates_to_facts`

- Starting AVD 5.0.0, `eos_validate_state` will use ANTA as backend, which will change the default behavior (same as setting `use_anta: true` in older versions).
Please review the changes described on the ANTA integration page.

### Fixed issues in eos_cli_config_gen

- Fix(eos_cli_config_gen): Fix the templates for event-handlers by @Shivani-gslab in https://github.com/aristanetworks/avd/pull/4055
Expand Down
1 change: 1 addition & 0 deletions ansible_collections/arista/avd/docs/semantic-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ All roles input variables follow SemVer. Any breaking changes will, at a minimum
| Action: `validate_and_template` ||| Internal plugin, not intended for external use. |
| Action: `verify_requirements` ||| Internal plugin, not intended for external use. |
| Action: `yaml_templates_to_facts` ||| Internal plugin, not intended for external use. |
| Action: `_emit_warning` ||| Internal plugin, not intended for external use. |
| Test: `contains` ||| |
| Test: `defined` ||| |
| Test: `global_vars` ||| |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ interface Management1

#### Tunnel Interfaces Summary

| Interface | Description | VRF | MTU | Shutdown | NAT Profile | Mode | Source Interface | Destination | PMTU-Discovery | IPsec Profile |
| --------- | ----------- | --- | --- | -------- | ----------- | ---- | ---------------- | ----------- | -------------- | ------------- |
| Tunnel1 | test ipv4 only | Tunnel-VRF | 1500 | False | - | ipsec | Ethernet42 | 6.6.6.6 | True | - |
| Tunnel2 | test ipv6 only | default | - | True | NAT-PROFILE-NO-VRF-2 | gre | Ethernet42 | dead:beef::1 | False | Profile-2 |
| Tunnel3 | test dual stack | default | 1500 | - | - | ipsec | Ethernet42 | 1.1.1.1 | - | Profile-3 |
| Tunnel4 | test no tcp_mss | default | 1500 | - | NAT-PROFILE-NO-VRF-1 | - | Ethernet42 | 1.1.1.1 | - | - |
| Interface | Description | VRF | Underlay VRF | MTU | Shutdown | NAT Profile | Mode | Source Interface | Destination | PMTU-Discovery | IPsec Profile |
| --------- | ----------- | --- | ------------ | --- | -------- | ----------- | ---- | ---------------- | ----------- | -------------- | ------------- |
| Tunnel1 | test ipv4 only | Tunnel-VRF | Underlay-VRF | 1500 | False | - | ipsec | Ethernet42 | 6.6.6.6 | True | - |
| Tunnel2 | test ipv6 only | default | default | - | True | NAT-PROFILE-NO-VRF-2 | gre | Ethernet42 | dead:beef::1 | False | Profile-2 |
| Tunnel3 | test dual stack | default | default | 1500 | - | - | ipsec | Ethernet42 | 1.1.1.1 | - | Profile-3 |
| Tunnel4 | test no tcp_mss | default | default | 1500 | - | NAT-PROFILE-NO-VRF-1 | - | Ethernet42 | 1.1.1.1 | - | - |

##### IPv4

Expand Down Expand Up @@ -80,6 +80,7 @@ interface Tunnel1
tunnel mode ipsec
tunnel source interface Ethernet42
tunnel destination 6.6.6.6
tunnel underlay vrf Underlay-VRF
tunnel path-mtu-discovery
comment
Comment created from eos_cli under tunnel_interfaces.Tunnel1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface Tunnel1
tunnel mode ipsec
tunnel source interface Ethernet42
tunnel destination 6.6.6.6
tunnel underlay vrf Underlay-VRF
tunnel path-mtu-discovery
comment
Comment created from eos_cli under tunnel_interfaces.Tunnel1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tunnel_interfaces:
description: test ipv4 only
shutdown: false
vrf: Tunnel-VRF
underlay_vrf: Underlay-VRF
mtu: 1500
ip_address: 42.42.42.42/24
access_group_in: test-in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ interface Ethernet47
| Interface | Description | Type | Mode | VLANs | Native VLAN | Trunk Group | LACP Fallback Timeout | LACP Fallback Mode | MLAG ID | EVPN ESI |
| --------- | ----------- | ---- | ---- | ----- | ----------- | ------------| --------------------- | ------------------ | ------- | -------- |
| Port-Channel1 | SRV01_bond0 | switched | trunk | 2-3000 | - | - | - | - | - | 0000:0000:0404:0404:0303 |
| Port-Channel30 | deprecate_filters_testing | switched | access | - | - | - | - | - | - | deaf:beed:0303:0202:0101 |
| Port-Channel51 | ipv6_prefix | switched | trunk | 1-500 | - | - | - | - | - | - |

##### Flexible Encapsulation Interfaces
Expand Down Expand Up @@ -757,6 +758,14 @@ interface Port-Channel2.1000
route-target import 03:03:02:02:01:01
lacp system-id 0303.0202.0101
!
interface Port-Channel30
description deprecate_filters_testing
switchport
evpn ethernet-segment
identifier deaf:beed:0303:0202:0101
route-target import 03:03:02:02:01:01
lacp system-id 0303.0202.0101
!
interface Port-Channel51
description ipv6_prefix
switchport
Expand Down Expand Up @@ -804,10 +813,10 @@ interface Loopback1

#### Tunnel Interfaces Summary

| Interface | Description | VRF | MTU | Shutdown | NAT Profile | Mode | Source Interface | Destination | PMTU-Discovery | IPsec Profile |
| --------- | ----------- | --- | --- | -------- | ----------- | ---- | ---------------- | ----------- | -------------- | ------------- |
| Tunnel3 | test dual stack | default | 1500 | - | - | - | Ethernet42 | 1.1.1.1 | - | - |
| Tunnel4 | test no tcp_mss | default | 1500 | - | - | - | Ethernet42 | 1.1.1.1 | - | - |
| Interface | Description | VRF | Underlay VRF | MTU | Shutdown | NAT Profile | Mode | Source Interface | Destination | PMTU-Discovery | IPsec Profile |
| --------- | ----------- | --- | ------------ | --- | -------- | ----------- | ---- | ---------------- | ----------- | -------------- | ------------- |
| Tunnel3 | test dual stack | default | default | 1500 | - | - | - | Ethernet42 | 1.1.1.1 | - | - |
| Tunnel4 | test no tcp_mss | default | default | 1500 | - | - | - | Ethernet42 | 1.1.1.1 | - | - |

##### IPv4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ interface Port-Channel2.1000
route-target import 03:03:02:02:01:01
lacp system-id 0303.0202.0101
!
interface Port-Channel30
description deprecate_filters_testing
switchport
evpn ethernet-segment
identifier deaf:beed:0303:0202:0101
route-target import 03:03:02:02:01:01
lacp system-id 0303.0202.0101
!
interface Port-Channel51
description ipv6_prefix
switchport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ port_channel_interfaces:
rt: 03:03:02:02:01:01
lacp_id: 0303.0202.0101

# Testing deprecated filter plugins to be remove in AVD 5.0.0
Port-Channel30:
description: deprecate_filters_testing
esi: "{{ '0303:0202:0101' | arista.avd.generate_esi('deaf:beed:') }}"
rt: "{{ '0303:0202:0101' | arista.avd.generate_route_target }}"
lacp_id: "{{ '0303:0202:0101' | arista.avd.generate_lacp_id }}"


Port-Channel51:
description: ipv6_prefix
vlans: 1-500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
delegate_to: localhost
ansible.builtin.import_role:
name: arista.avd.eos_validate_state
# Save catalogs
vars:
use_anta: true
save_catalog: true
27 changes: 27 additions & 0 deletions ansible_collections/arista/avd/plugins/action/_emit_warning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
"""Temporary file to emit a warning."""

from ansible.plugins.action import ActionBase
from ansible.utils.display import Display

display = Display()

__metaclass__ = type


class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
if task_vars is None:
task_vars = {}

result = super().run(tmp, task_vars)
del tmp

if self._task.args:
message = self._task.args.get("message")

display.warning(message)

return result
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def prepare_task_vars(self, task_vars: dict, structured_config_filename: str, *,
try:
task_vars[var] = self._templar.template(task_vars[var], fail_on_undefined=False)
except Exception as e:
raise AnsibleActionFail(f"Exception during templating of task_var '{var}'") from e
raise AnsibleActionFail(f"Exception during templating of task_var '{var}': '{e}'") from e

if not isinstance(task_vars, dict):
# Corner case for ansible-test where the passed task_vars is a nested chain-map
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
#
# deprecated filters - grouped together to avoid Ansible to generate warning on loading the module name...
#

__metaclass__ = type

from ansible.errors import AnsibleFilterError

from ansible_collections.arista.avd.plugins.plugin_utils.pyavd_wrappers import RaiseOnUse, wrap_filter

PLUGIN_NAME_1 = "arista.avd.generate_lacp_id"
PLUGIN_NAME_2 = "arista.avd.generate_esi"
PLUGIN_NAME_3 = "arista.avd.generate_route_target"

try:
from pyavd.j2filters import generate_esi, generate_lacp_id, generate_route_target
except ImportError as e:
generate_lacp_id = RaiseOnUse(
AnsibleFilterError(
f"The '{PLUGIN_NAME_1}' plugin requires the 'pyavd' Python library. Got import error",
orig_exc=e,
)
)
generate_esi = RaiseOnUse(
AnsibleFilterError(
f"The '{PLUGIN_NAME_2}' plugin requires the 'pyavd' Python library. Got import error",
orig_exc=e,
)
)
generate_route_target = RaiseOnUse(
AnsibleFilterError(
f"The '{PLUGIN_NAME_3}' plugin requires the 'pyavd' Python library. Got import error",
orig_exc=e,
)
)


class FilterModule(object):
def filters(self):
return {
"generate_lacp_id": wrap_filter(PLUGIN_NAME_1)(generate_lacp_id),
"generate_esi": wrap_filter(PLUGIN_NAME_2)(generate_esi),
"generate_route_target": wrap_filter(PLUGIN_NAME_3)(generate_route_target),
}
Loading

0 comments on commit 643fa51

Please sign in to comment.