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

add hostname_field option #1312

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

rkearsley
Copy link
Contributor

Related Issue

#1305

New Behavior

added option "hostname_field"
If set, sets the inventory hostname from this field in custom_fields

...

Contrast to Current Behavior

Currently, the inventory hostname is always the netbox device name

...

Discussion: Benefits and Drawbacks

In netbox, my device names are a human readable name, with white spaces - they aren't compatible as an inventory hostname.
For the actual "hostname" I use a custom field "Ansible sys_hostname". This PR allows to set any field from custom_fields as the hostname.
If the new hostname_field is not set, it falls back to the default behaviour

...

Changes to the Documentation

...

Proposed Release Note Entry

added option "hostname_field" to enable setting the inventory hostname to the value of a custom_field, rather than the default behaviour of using the netbox device name

...

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.

@rkearsley rkearsley marked this pull request as ready for review September 5, 2024 14:45
@rodvand rodvand merged commit 030601b into netbox-community:devel Sep 12, 2024
50 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.

2 participants