netbox-community / ansible_modules

NetBox modules for Ansible using Ansible Collections
GNU General Public License v3.0
333 stars 216 forks source link

[Feature]: Add prefix string to groups and hostvars output by nb_inventory plugin #959

Open h3po opened 1 year ago

h3po commented 1 year ago

NetBox version

v3.4.6

Feature type

Change to existing Plugin

Proposed functionality

Add an option to the inventory plugin to add a string prefix (such as "netbox_") to group names and hostvars, so for example "role_switch" becomes "netbox_role_switch" and "primary_ipv4" becomes "netbox_primary_ipv4".

Use case

Preventing naming collisions when using netbox dynamic inventory alongside static or other dynamic inventory plugins - other dynamic inventory sources already do this.

External dependencies

No response

sc68cal commented 1 year ago

I could see a case for us prefixing everything with netbox_ by default, like you said other dynamic inventory plugins do this already.

h3po commented 1 year ago

I could use help getting the unit tests to run, so I can add tests for the new options. https://netdev-community.slack.com/archives/C01PFAT9VB8/p1680188657405779

sc68cal commented 1 year ago

You need to create a pull request and that will run the tests in our CI system