Skip to content

Conversation

@mulmat
Copy link
Contributor

@mulmat mulmat commented Mar 6, 2024

Related Issue

New Behavior

Only extract custom fields that are set. Netbox supports having non-required custom fields, and we don't want to set variables when the custom fields are not set in Netbox. This is particularly valuable if you are using flatten_custom_fields=True.

Contrast to Current Behavior

Custom fields that are not set in Netbox will be respected and not set in the Ansible module (e.g., they won't overwrite the variable if it's already set).

Discussion: Benefits and Drawbacks

When flatten_custom_fields=False, the custom fields which are unset will be excluded from the custom_fields dictionary. I don't think this will cause any issues.

Changes to the Documentation

...

Proposed Release Note Entry

Unset custom fields, in combination with flatten_custom_fields=True, will no longer overwrite host variables.

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.

@rodvand rodvand merged commit 4c3065f into netbox-community:devel Apr 28, 2024
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.

2 participants