Add prefix string to groups and hostvars output by nb_inventory plugin #984
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
devel
branch.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.