Add prefix string to groups and hostvars output by nb_inventory plugin
Related Issue
#959
New Behavior
Adds new boolean parameters group_names_prefix and host_vars_prefix to the inventory plugin to add the string prefix "netbox_" to group names and hostvars, so for example "role_switch" becomes "netbox_role_switch" and "primary_ipv4" becomes "netbox_primary_ipv4".
Contrast to Current Behavior
Currently the inventory plugin does not prefix its group and hostvars names, potentially creating name collisions when used in conjunction with static inventory
Discussion: Benefits and Drawbacks
Benefit: Users can optionally enable the prefix. By having it disabled by default, the change is backwards compatible with existing configs. Drawbacks: None
Changes to the Documentation
Documentation for the new parameters are included in the PR.
Proposed Release Note Entry
Added parameters group_names_prefix and host_vars_prefix to the inventory plugin
Double Check
- [x] I have read the comments and followed the CONTRIBUTING.md.
- [x] I have explained my PR according to the information in the comments or in a linked issue.
- [x] My PR targets the
develbranch.
I have read the contributing guidelines, but unit tests are currently missing, as I can not get them to run locally. @sc68cal told me to create a pull request anyway.
@sc68cal you requested that i open this pull request to have it ci tested, but the pipeline failed due to unrelated issues. I don't know how to retrigger it
I tried browsing around for a way to re-run the checks, but couldn't find it. Since this PR is outdated, please merge from master and re-push, and that will re-trigger
I corrected a mistake in the PR description above: the options are boolean parameters, adding a fixed prefix of "netbox_". Not string parameters.