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

Feat: New anta_workflow plugin using PyAVD #4196

Draft
wants to merge 42 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
06e3759
ANTA workflows
carl-baillargeon Aug 17, 2024
1da751d
Update BGP tests
carl-baillargeon Sep 9, 2024
3e78cff
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Oct 26, 2024
e4d7414
Rebase and update code
carl-baillargeon Oct 31, 2024
df5701f
Update a few things
carl-baillargeon Nov 4, 2024
42bf51e
Update Argument Spec
carl-baillargeon Nov 4, 2024
9ee6222
Merge branch 'devel' into feat/move_anta_to_pyavd
gmuloc Nov 13, 2024
6f3ac74
Merge branch 'devel' into feat/move_anta_to_pyavd
MaheshGSLAB Nov 14, 2024
4e20dbf
added more tests
MaheshGSLAB Nov 22, 2024
69b1312
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 22, 2024
ba497d2
Merge branch 'devel' into feat/move_anta_to_pyavd
MaheshGSLAB Nov 25, 2024
18d98be
added role and molecule anta_runner
MaheshGSLAB Nov 25, 2024
32b1e34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 25, 2024
9167aef
Light changes
carl-baillargeon Nov 21, 2024
c0fbb83
Added Filter
carl-baillargeon Nov 25, 2024
5031c5a
Added multiprocessing
carl-baillargeon Dec 4, 2024
a541897
Refactor fabric_data
carl-baillargeon Dec 6, 2024
8c8243f
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Dec 7, 2024
f9d8b7a
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Dec 17, 2024
a4d9f1b
Refactor a lot of things
carl-baillargeon Dec 28, 2024
e14b5d5
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Dec 28, 2024
1044d2f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2024
22b7384
Clean-up
carl-baillargeon Dec 28, 2024
81bf44f
Update anta_runner role
carl-baillargeon Dec 29, 2024
e2d81b2
Fix logging again...
carl-baillargeon Dec 30, 2024
33eadb7
Clean-up molecule files
carl-baillargeon Dec 30, 2024
97974da
Fix bugs
carl-baillargeon Dec 30, 2024
8cdb28f
Fix bugs
carl-baillargeon Dec 30, 2024
3208742
Minor fixes
carl-baillargeon Dec 30, 2024
bc49db0
Added ANTA to cv-pathfinder example
carl-baillargeon Dec 30, 2024
71dbc36
Dry-run
carl-baillargeon Dec 30, 2024
322be88
Fix molecule
carl-baillargeon Dec 30, 2024
085e7bf
Add molecule
carl-baillargeon Dec 30, 2024
137d1f5
Added unit tests
carl-baillargeon Dec 31, 2024
9b6fd86
Update doc
carl-baillargeon Dec 31, 2024
2b286c0
Update eos_validate_state molecule with ANTA 1.2
carl-baillargeon Dec 31, 2024
5b60a4b
Minor fixes
carl-baillargeon Dec 31, 2024
3988c2d
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Jan 3, 2025
05a3c59
Update molecule after rebase
carl-baillargeon Jan 8, 2025
084f248
Merge branch 'devel' into feat/move_anta_to_pyavd
carl-baillargeon Jan 8, 2025
4bc5ebd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2025
1aa084f
Fixes
carl-baillargeon Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
# This title is used for search results
title: arista.avd.anta_workflow
---
<!--
~ Copyright (c) 2023-2025 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->

# anta_workflow

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

!!! warning "This module is in **preview** mode"
This module is not guaranteed to have a backwards compatible interface.

Uses ANTA from Ansible

## Synopsis

The `arista.avd.anta_workflow` module is an Ansible Action Plugin to leverage the ANTA test framework to validate that the generated structured configurations by AVD are applied to the devices and that the deployed network is working correctly. It can also be used to execute user-defined ANTA test catalogs in conjunction with the Ansible inventory, providing similar functionality and options as the ANTA CLI while benefiting from Ansible&#39;s inventory management capabilities.

The plugin offers the following capabilities:
- Generating a per-device test catalog based on the AVD structured_config.
- WIP

## Parameters

| Argument | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| <samp>device_list</samp> | list | True | None | | List of devices to run ANTA tests against. These devices must be defined in the Ansible inventory. |
| <samp>anta_catalog</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;output_dir</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;structured_config_dir</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;structured_config_suffix</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;scope</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boundary</samp> | str | optional | unlimited | Valid values:<br>- <code>unlimited</code><br>- <code>fabric</code><br>- <code>dc</code><br>- <code>pod</code><br>- <code>rack</code> | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allow_bgp_external</samp> | bool | optional | False | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allow_bgp_vrfs</samp> | bool | optional | False | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;filters</samp> | list | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;device_list</samp> | list | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;run_tests</samp> | list | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skip_tests</samp> | list | optional | None | | WIP |
| <samp>custom_catalog</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;input_dir</samp> | str | optional | None | | WIP |
| <samp>anta_logging</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;log_dir</samp> | str | optional | None | | WIP |
| <samp>anta_runner_settings</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;timeout</samp> | float | optional | 30.0 | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;batch_size</samp> | int | optional | 5 | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;dry_run</samp> | bool | optional | False | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;tags</samp> | list | optional | None | | WIP |
| <samp>report</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;fabric_data_output</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;csv_output</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;md_output</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;json_output</samp> | str | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;filters</samp> | dict | optional | None | | WIP |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hide_statuses</samp> | list | optional | None | Valid values:<br>- <code>success</code><br>- <code>failure</code><br>- <code>error</code><br>- <code>skipped</code><br>- <code>unset</code> | WIP |

## Notes

- Documentation is a work in progress.

## See Also

- ANTA website: [https://anta.arista.com](https://anta.arista.com)<br>Documentation for the ANTA test framework

## Examples

```yaml
- name: Run ANTA
arista.avd.anta_workflow:
device_list: "{{ ansible_play_hosts }}"
anta_catalog:
output_dir: "/my_avd_project/anta/catalogs"
structured_config_dir: "/my_avd_project/intended/structured_configs"
structured_config_suffix: ".yml"
scope:
boundary: "fabric"
allow_bgp_external: true
allow_bgp_vrfs: true
filters:
skip_tests:
- VerifyNTP
custom_catalog:
input_dir: "/my_avd_project/anta/my_catalogs"
anta_logging:
log_dir: "/my_avd_project/anta/logs"
report:
fabric_data_output: "/my_avd_project/anta/reports/fabric_data.json"
csv_output: "/my_avd_project/anta/reports/anta_results.csv"
md_output: "/my_avd_project/anta/reports/anta_results.md"
json_output: "/my_avd_project/anta/reports/anta_results.json"
filters:
hide_statuses:
- success
register: anta
delegate_to: localhost
run_once: true
```

## Authors

- Arista Ansible Team (@aristanetworks)
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
anta_runner
eos_cli_config_gen
eos_cli_config_gen_deprecated_vars
eos_config_deploy_cvp
Expand Down
Loading
Loading