Skip to content

Feat(eos_cli_config_gen): Adding new keys for inner_vlan_mask and inner_vlan_number under ip_access_lists#6776

Open
Shivani-gslab wants to merge 8 commits intoaristanetworks:develfrom
Shivani-gslab:inner_vlan_ip_access_lists
Open

Feat(eos_cli_config_gen): Adding new keys for inner_vlan_mask and inner_vlan_number under ip_access_lists#6776
Shivani-gslab wants to merge 8 commits intoaristanetworks:develfrom
Shivani-gslab:inner_vlan_ip_access_lists

Conversation

@Shivani-gslab
Copy link
Copy Markdown
Contributor

@Shivani-gslab Shivani-gslab commented Mar 30, 2026

Change Summary

Adding new keys for inner_vlan_mask and inner_vlan_number under ip_access_lists

Related Issue(s)

Fixes #6749

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

  • Adding new keys for inner_vlan_mask and inner_vlan_number
  • Deprecating vlan_inner key

How to test

Molecule tests added

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Mar 30, 2026
@github-actions
Copy link
Copy Markdown

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-6776
# Activate the virtual environment
source test-avd-pr-6776/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Shivani-gslab/avd.git@inner_vlan_ip_access_lists#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
python -m ansible.cli.galaxy collection install git+https://github.com/Shivani-gslab/avd.git#/ansible_collections/arista/avd/,inner_vlan_ip_access_lists --force
cd test-avd-pr-6776
# Run your playbook using `python -m ansible.cli.playbook path/to/playbook.yml ...`

You can also test this PR using AVD playground:

  • Rebase your branch to makes sure it is up-to-date and has latest lab topologies for example inventories
  • Authenticate on labs.arista.com. Use your email! Not login.
  • Start the playground
  • In the lab selector UI pick "I want to use a specific AVD fork"
  • Enter following parameters:
GitHub org: Shivani-gslab
Repository name: avd
Branch: inner_vlan_ip_access_lists
  • Select an example inventory to test the PR
  • Once the AVD Playground setup will be finished, type make start and test anything once the lab is up

# TTL value.
ttl: <int; 0-255>
ttl_match: <str; "eq" | "gt" | "lt" | "neq"; default="eq">
# This key is deprecated.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key deprecated from eos_designs as well so we need to update the code

Copy link
Copy Markdown
Contributor Author

@Shivani-gslab Shivani-gslab Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no specific code for this in eos_designs, it is reading the ipv4_acls and casting it to eos_cli_config_gen

if acl_name in self.inputs.ipv4_acls:
            # pass substitution fields as anything to check if acl requires substitution or not
            acl = self.shared_utils.get_ipv4_acl(acl_name, "random", interface_ip="random", peer_ip="random")
            if acl.name == acl_name:
                # ACL doesn't need replacement
                self.structured_config.ip_access_lists.append(acl._cast_as(EosCliConfigGen.IpAccessListsItem))
                return

There were no tests for this key, I have added the test for this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check by keeping both keys in a tests and how it behaves

Copy link
Copy Markdown
Contributor Author

@Shivani-gslab Shivani-gslab Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I tried that, if we give both it generates both the keys in structured config (since we are directly using cast_as on the ipv4_acl element) but no diffs in config.

@ClausHolbechArista I would like to confirm, if its okay to keep like this? or we should refactor the code to have conditions to generate any one of these keys in structured_config?

  - name: TEST-IPV4-ACL-WITH-IP-FIELDS-OUT_Ethernet2
     protocol: ip
     source: 172.20.20.1/30
     destination: 172.20.20.0
+    vlan_inner: true
     inner_vlan_number: 123
     inner_vlan_mask: '0x000'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the deprecation not blocking this with a conflict? I am not saying we should do anything in eos_designs logic but I would expect the schema to catch this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried giving the single key in new_key still its passing with no error

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.36%. Comparing base (60fe0fa) to head (e95004f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            devel    #6776   +/-   ##
=======================================
  Coverage   87.36%   87.36%           
=======================================
  Files         351      351           
  Lines       19358    19358           
  Branches     3619     3619           
=======================================
  Hits        16912    16912           
  Misses       1884     1884           
  Partials      562      562           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Shivani-gslab Shivani-gslab force-pushed the inner_vlan_ip_access_lists branch from bc2338f to bf60a74 Compare April 3, 2026 11:47
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review April 7, 2026 05:23
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners April 7, 2026 05:23
ip access-list TEST-IPV4-ACL-WITH-IP-FIELDS-IN_Ethernet5_1
15 deny ip any host 172.20.20.0
permit ip 172.20.20.1/30 host 172.20.20.0
permit vlan inner 123 0x000 ip 172.20.20.1/30 host 172.20.20.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you have vlan inner xxx and vlan xxx at the same time? If not I think the old boolean worked fine to just add the inner keyword before the vlan and mask.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions bot added the type: code quality CI and development toolset label Apr 7, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@Shivani-gslab Shivani-gslab force-pushed the inner_vlan_ip_access_lists branch from e95004f to 4724e0c Compare April 7, 2026 12:20
@github-actions github-actions bot removed the type: code quality CI and development toolset label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

role: eos_cli_config_gen issue related to eos_cli_config_gen role role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for inner_vlan_mask in IPv4 entries

3 participants