Skip to content

Conversation

@Larzenegger
Copy link
Contributor

Related Issue

#1026

New Behavior

It would be possible to include a tenant parameter when using the module, e.g.

  tasks:
    - name: Create cable within NetBox with only required information
      netbox.netbox.netbox_cable:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          tenant: tenant-slug
          termination_a_type: dcim.interface
          termination_a:
            device: Test Nexus Child One
            name: Ethernet2/2
          termination_b_type: dcim.interface
          termination_b:
            device: Test Nexus Child One
            name: Ethernet2/1
        state: present

Contrast to Current Behavior

Currently rejected, "unsupported parameters for (netbox.netbox.netbox_cable) module: data.tenant."

Discussion: Benefits and Drawbacks

Users of this module could set the tenant without resorting to the UI.

Changes to the Documentation

Parameter documentation should be included in PR.

Proposed Release Note Entry

add optional parameter tenant to netbox_cable

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR targets the devel branch.

Copy link
Contributor

@sc68cal sc68cal left a comment

Choose a reason for hiding this comment

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

please add at least one unit test exercising this code path

@Larzenegger
Copy link
Contributor Author

So far I've struggled to identify an existing unit test that I could extend, or how I would go about creating a new one. Would it be helpful if I added a test case to integration/'target//v3.[345]/tasks/netbox_cable.yml?

@sc68cal
Copy link
Contributor

sc68cal commented Jun 29, 2023

Would it be helpful if I added a test case to integration/'target//v3.[345]/tasks/netbox_cable.yml?

Yes. Specifically, I believe CABLE 3: ASSERT - Update Cable with other fields would be the location

@rodvand rodvand merged commit 0215e17 into netbox-community:devel Jun 30, 2023
@Larzenegger Larzenegger deleted the cable-tenant branch August 12, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants