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 prefix string to groups and hostvars output by nb_inventory plugin #984

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

h3po
Copy link

@h3po h3po commented Apr 19, 2023

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

  • 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.

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.

@h3po h3po changed the title Var prefix Add prefix string to groups and hostvars output by nb_inventory plugin Apr 19, 2023
@h3po
Copy link
Author

h3po commented Aug 8, 2023

@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

@sc68cal
Copy link
Contributor

sc68cal commented Aug 9, 2023

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

@h3po
Copy link
Author

h3po commented Aug 30, 2023

I corrected a mistake in the PR description above: the options are boolean parameters, adding a fixed prefix of "netbox_". Not string parameters.

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