Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds VRF (Virtual Routing and Forwarding) association support to the vyos_interfaces resource module, updating the module schema, facts parsing, and test suites to ensure VRF configuration can be set/removed and correctly represented in structured data.
Changes:
- Extend
vyos_interfacesargspec/module documentation to accept an interface-levelvrfparameter. - Update interfaces facts parsing to include
vrfso state operations (replaced/overridden/deleted) can detect and remove VRF assignments. - Add/extend unit + integration test coverage and fixtures to validate VRF set/remove/idempotency behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
plugins/modules/vyos_interfaces.py |
Documents new vrf option for interface configuration. |
plugins/module_utils/network/vyos/argspec/interfaces/interfaces.py |
Adds vrf to the argspec so it’s accepted/validated. |
plugins/module_utils/network/vyos/facts/interfaces/interfaces.py |
Extends parsing to include vrf in gathered/parsed facts. |
plugins/module_utils/network/vyos/config/interfaces/interfaces.py |
No functional change; minor formatting only. |
tests/unit/modules/network/vyos/test_vyos_interfaces.py |
Adds unit tests for VRF removal/idempotency/additional VRF behavior. |
tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config_vrf.cfg |
New fixture representing an interface VRF assignment. |
tests/integration/targets/vyos_interfaces/vars/main.yaml |
Updates expected command/parsed structures to include VRF fields. |
tests/integration/targets/vyos_interfaces/tests/cli/*.yaml |
Updates integration scenarios to configure/assert VRF behavior and sets up VRFs for tests. |
tests/integration/targets/vyos_interfaces/tests/cli/_setup_vrfs.yaml |
Adds shared setup to create VRF instances used by tests. |
tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml |
Extends cleanup to remove interface VRF assignments and VRFs. |
tests/integration/targets/vyos_interfaces/tests/cli/_parsed_config.cfg |
Adds VRF line to parsed-config fixture. |
docs/vyos.vyos.vyos_interfaces_module.rst |
Updates generated docs to include the vrf parameter. |
changelogs/fragments/t8349_vyos_interfaces_vrf.yml |
Adds changelog entry for VRF support. |
bindep.txt |
Adds a new bindep dependency selector entry (needs adjustment). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Types of changes
Related Task(s)
https://vyos.dev/T6836
Related PR(s)
Component(s) name
Proposed changes
How to test
============================= 397 passed in 7.72s ==============================
Run command with stdout: docker exec --user pytest -i ansible-test-controller-vK6wsmud sh -c 'tar cf - -C /root/ansible_collections/vyos/vyos/tests --exclude .tmp output | gzip'
Run command with stdin: tar oxzf - -C /home/d368409/work/work12.vyos/lab/ansible/collections/ansible_collections/vyos/vyos/tests
Run command: docker stop -t 0 ansible-test-controller-vK6wsmud
Run command: docker rm ansible-test-controller-vK6wsmud
Test results
Tested against VyOS versions:
Checklist:
changelogs/fragmentsto describe the changes