Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont extract null values from custom fields (nb_inventory) #1184

Merged
merged 1 commit into from
Apr 28, 2024

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
8 checks passed
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.

None yet

2 participants