Skip to content

T8349 VRF config for interfaces#449

Open
omnom62 wants to merge 34 commits intovyos:mainfrom
omnom62:t8349_l3_ifs_vrf
Open

T8349 VRF config for interfaces#449
omnom62 wants to merge 34 commits intovyos:mainfrom
omnom62:t8349_l3_ifs_vrf

Conversation

@omnom62
Copy link
Copy Markdown
Contributor

@omnom62 omnom62 commented Mar 7, 2026

Change Summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6836

Related PR(s)

Component(s) name

Proposed changes

How to test

  • generated xml file: /root/ansible_collections/vyos/vyos/tests/output/junit/python3.13-controller-units.xml -
    ============================= 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

  • Sanity tests passed
  • Unit tests passed

Tested against VyOS versions:

  • 1.4.2
  • 1.5.q2

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the ansible sanity and unit tests
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added unit tests to cover my changes
  • I have added a file to changelogs/fragments to describe the changes

@omnom62 omnom62 requested a review from a team as a code owner March 7, 2026 22:11
@omnom62 omnom62 requested review from andamasov, dmbaturin and gaige March 7, 2026 22:11
@omnom62 omnom62 changed the title WIP VRF config for interfaces WIP T8349 VRF config for interfaces Mar 7, 2026
@omnom62 omnom62 marked this pull request as draft March 7, 2026 22:17
@omnom62 omnom62 changed the title WIP T8349 VRF config for interfaces T8349 VRF config for interfaces Mar 10, 2026
@omnom62 omnom62 marked this pull request as ready for review March 16, 2026 10:51
Copilot AI review requested due to automatic review settings April 17, 2026 12:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_interfaces argspec/module documentation to accept an interface-level vrf parameter.
  • Update interfaces facts parsing to include vrf so 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.

Comment thread bindep.txt
Comment thread changelogs/fragments/t8349_vyos_interfaces_vrf.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants