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

Open
wants to merge 61 commits into
base: devel
Choose a base branch
from

Conversation

carl-baillargeon
Copy link
Contributor

@carl-baillargeon carl-baillargeon commented Jul 9, 2024

Change Summary

  • anta_workflow Ansible action plugin
  • anta_runner Ansible role
  • get_device_anta_catalog function in PyAVD to generate the ANTA catalogs
  • ANTA test index with their input factories in PyAVD

Requirements

NEEDS ANTA v1.3.0

On ANTA:

On AVD:

Component(s) name

PyAVD

Proposed changes

Example playbook for anta_runner role:

---
- name: Validate AVD
  hosts: GLOBAL
  tasks:
    - name: Run ANTA on EOS devices
      import_role:
        name: arista.avd.anta_runner

To-do list

  • Add reporting using anta.reporter.csv_reporter and anta.reporter.md_reporter. We should also be able to filter statuses (from plugin arguments) using ResultManager.filter()
  • Input factory for VerifyAVTRole 4e20dbf
  • Input factory for VerifyMlagStatus
  • Input factory for VerifyRoutingProtocolModel 4e20dbf
  • Input factory for VerifyAPIHttpsSSL
  • Input factory for VerifySpecificIPSecConn 4e20dbf
  • Input factory for VerifyStunClient 4e20dbf
  • Input factory for VerifyNTP 4e20dbf
  • Input factory for VerifyReloadCause 4e20dbf
  • VerifyLLDP factory: Add support for validate_state: false configuration 4e20dbf
  • Create the Ansible role (anta_runner) that will run the action plugin anta_workflows - Similar to cv_deploy & cv_workflows 18d98be
  • Complete anta_workflow plugin documentation under plugins.modules
  • Complete README.md for anta_runner role
  • Add support for BGP VRFs (see Feat(eos_validate_state): Add validation for BGP IPv4 peers in VRFs #4538)
  • Molecule tests
  • Unit tests in PyAVD

Some tests don't require any inputs, in that case we just update PYAVD_TEST_INDEX

Phase 2:

  • Expose more variables in the structured config schema for testing (accepted_pwr_supply_states, accepted_fan_states, accepted_xcvr_manufacturers, eos_version, etc.)
  • Add more ANTA tests 🥇
  • Improve reporting (HTML) when feat(anta): add test atomic results anta#937 is merged

Copy link

github-actions bot commented Jul 9, 2024

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-4196
# Activate the virtual environment
source test-avd-pr-4196/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/carl-baillargeon/avd.git@feat/move_anta_to_pyavd#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/carl-baillargeon/avd.git#/ansible_collections/arista/avd/,feat/move_anta_to_pyavd --force
# Optional: Install AVD examples
cd test-avd-pr-4196
ansible-playbook arista.avd.install_examples

@gmuloc gmuloc added this to the v5.0.0 milestone Jul 25, 2024
@carl-baillargeon carl-baillargeon force-pushed the feat/move_anta_to_pyavd branch 2 times, most recently from 8853a02 to da57595 Compare August 13, 2024 18:18
@carl-baillargeon carl-baillargeon changed the title Feat: ANTA Integration to PyAVD Feat: New anta_workflow plugin and anta_runner role to Ansible AVD collection using PyAVD Aug 13, 2024
@carl-baillargeon carl-baillargeon force-pushed the feat/move_anta_to_pyavd branch from da57595 to 7b8c139 Compare August 17, 2024 14:59
Copy link

@ClausHolbechArista ClausHolbechArista removed this from the v5.0.0 milestone Sep 20, 2024
@carl-baillargeon carl-baillargeon changed the title Feat: New anta_workflow plugin and anta_runner role to Ansible AVD collection using PyAVD Feat: New anta_workflow plugin using PyAVD Oct 31, 2024
@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Nov 25, 2024
@carl-baillargeon carl-baillargeon marked this pull request as ready for review January 10, 2025 04:38
@carl-baillargeon carl-baillargeon requested review from a team as code owners January 10, 2025 04:38
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Jan 14, 2025
@github-actions github-actions bot removed the state: conflict PR with conflict label Feb 21, 2025
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added state: conflict PR with conflict and removed type: documentation Improvements or additions to documentation state: conflict PR with conflict labels Feb 21, 2025
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
21.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: build_output_folders issue related to build_output_folders role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: code quality CI and development toolset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants