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 52 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
  • get_fabric_data function in PyAVD to generate the fabric mappings used to generate the 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
  check_mode: yes
  tasks:
    - name: Run ANTA on EOS devices
      import_role:
        name: arista.avd.anta_runner

Example playbook for anta_workflow plugin:

---
- name: ANTA Workflow
  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_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

To-do list

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
  • Add evpn_multidomain knob to fabric scope to extend testing on border leafs

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
@github-actions github-actions bot added the state: conflict PR with conflict label Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

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

Copy link

github-actions bot commented Jan 3, 2025

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

@github-actions github-actions bot removed the state: conflict PR with conflict label Jan 3, 2025
@github-actions github-actions bot added the type: code quality CI and development toolset label Jan 9, 2025
@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
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: conflict PR with conflict state: Documentation role Updated type: code quality CI and development toolset type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants