An Ansible role that calculates the amplification factor of your Arista AVD data model — how many lines of EOS configuration are generated from your YAML input. Displays the result during the play and generates a Markdown report.
After your AVD build completes, this role:
- Counts lines across all data model input files (
group_vars/*.ymlandglobal_vars/*.yml) - Counts lines across all generated EOS config files (
intended/configs/*.cfg) - Displays the amplification factor in the play output
- Generates a Markdown report (
avd_intent_report.md) with file-level detail
TASK [avd_intent_report : AVD Amplification Factor] ****************************
ok: [spine-1] => {
"msg": "225 lines of input -> 3,626 lines of config = 16x amplification"
}
The generated Markdown includes:
- Centered amplification stats (input lines, output lines, Nx factor)
- Side-by-side file trees showing each input and output file with line counts
- Renders on GitHub, MkDocs, or any Markdown viewer that supports inline HTML
- Ansible with the
arista.avdcollection (you already have this if you're running AVD) - The
community.generalcollection
No Python dependencies beyond what AVD already requires.
Copy the avd_intent_report directory into your AVD repository's roles/ directory:
cp -r avd_intent_report /path/to/your/avd-repo/roles/Ensure your ansible.cfg includes the local roles path:
[defaults]
roles_path = ./rolesAdd the role to the end of your AVD build playbook:
---
- name: Build Fabric Switch Configuration
hosts: "{{ target_fabric }}"
gather_facts: false
tasks:
- name: Generate Structured Variables per Device
ansible.builtin.import_role:
name: arista.avd.eos_designs
- name: Generate Intended Config and Documentation
ansible.builtin.import_role:
name: arista.avd.eos_cli_config_gen
- name: Generate AVD Amplification Report
ansible.builtin.import_role:
name: avd_intent_reportThen run your build as usual:
ansible-playbook playbooks/build.yml -i sites/dc1/inventory.yml -e "target_fabric=dc1"The amplification factor will display during the play, and avd_intent_report.md will be generated in your repository root.
The role expects the standard AVD directory layout:
repo/
ansible.cfg
global_vars/
*.yml
roles/
avd_intent_report/
sites/<site>/
inventory.yml
group_vars/
*.yml
intended/
configs/
*.cfg
The role uses inventory_dir to locate group_vars/ and intended/configs/, and look for global_vars/ based on your inputs in ansible.cfg.
The report is written to avd_amplification/avd_intent_report.md in the site structure. It is self-contained Markdown with embedded HTML for the side-by-side layout — no external dependencies, works offline.
MIT