Add tenant field support to netbox_vlan_group#1518
Merged
Conversation
Adds tenant parameter to netbox_vlan_group module to support the tenant field added in NetBox 4.3+ (netbox-community/netbox#18690). NetBox Version Requirement: - Requires NetBox 4.3 or higher - Tested against NetBox 4.3 per existing CI matrix - Backward compatible with NetBox 4.4+ (not yet in CI test matrix) Changes: - Added tenant parameter to module DOCUMENTATION and argument_spec - Added example showing tenant usage in EXAMPLES section - Added comprehensive integration tests for tenant field in v4.3 target: * Test creating VLAN group with tenant * Test idempotency with tenant * Test updating tenant value * Test deletion of VLAN group with tenant Testing: - All 228 unit tests pass ✅ - Code formatted with black ✅ - Tenant functionality verified against NetBox 4.3 ✅ - Infrastructure for tenant field already exists in netbox_utils.py Fixes #1446 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
NetBox API returns tenant as an ID (integer) in responses, not as an expanded object. Updated test assertions to check tenant == 1 instead of tenant['name'] == 'Test Tenant' to match the pattern used in other integration tests.
Adds a second tenant to test data to support tenant update testing in netbox_vlan_group integration tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Documents the addition of tenant field support to netbox_vlan_group module in the changelog for the next release. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add GitHub issue URL to changelog fragment following project convention of including full issue URLs. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sc68cal
approved these changes
Feb 1, 2026
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.
Related Issue
#1446
New Behavior
The
netbox_vlan_groupmodule now supports thetenantfield, allowing users to assign VLAN groups to specific tenants in NetBox.Users can now specify a tenant when creating or updating VLAN groups:
Contrast to Current Behavior
Previously, the
netbox_vlan_groupmodule did not support thetenantfield, making it impossible to assign VLAN groups to tenants through Ansible automation. Users had to manually set tenants in the NetBox UI or use the API directly.Discussion: Benefits and Drawbacks
Benefits:
Drawbacks:
Backwards Compatibility:
Changes to the Documentation
tenantfield documentation to the module's argument specProposed Release Note Entry
netbox_vlan_group- Add tenant field support (#1446)Double Check
develbranch.