Skip to content

Conversation

@k-304
Copy link
Contributor

@k-304 k-304 commented Oct 23, 2023

Related Issue

No issue, context described below.

New Behavior

NetBox allows adding components (like power ports) to module types, not only to device types. This PR will address this.
Some users want to use module bays, hosting power supplies. This power supplies have a module type, which has power port templates. E.g: https://www.netbox.net/dcim/module-types/1/power-ports/

Contrast to Current Behavior

This PR adds module_type, which allows adding a power port to an existing module type in NetBox. Therefor one of device_type or module_type is required.

Discussion: Benefits and Drawbacks

This PR adds a feature that is already implemented in the NetBox GUI, but missing in the Ansible collection/module. For example, the device library uses module types for PSU's: https://github.com/netbox-community/devicetype-library/blob/a7718d8d4b0a9d2f196166f5cbc4831bfb6be490/device-types/HPE/ProLiant-DL580-Gen10.yaml#L13 and we can add modules with a module type to this slot. With the power port assigned to the module type, there will be a power port created with the module assignment. No further need to create additional power ports in an extra step.

Changes to the Documentation

All needed changes to the docs are included in the code.

Proposed Release Note Entry

Add the ability to create power ports for module types.

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.

@k-304 k-304 marked this pull request as ready for review October 23, 2023 13:30
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.

Needs a test exercising this functionality

@k-304 k-304 marked this pull request as draft October 30, 2023 14:22
@k-304 k-304 marked this pull request as ready for review November 1, 2023 07:34
@k-304 k-304 requested a review from sc68cal November 1, 2023 07:34
@k-304
Copy link
Contributor Author

k-304 commented Nov 1, 2023

Needs a test exercising this functionality

Added tests for v3.5 and v3.6.

@rodvand rodvand merged commit 9449f88 into netbox-community:devel Nov 2, 2023
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