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

Custom field for tags #16080

Open
fprina opened this issue May 10, 2024 · 6 comments
Open

Custom field for tags #16080

fprina opened this issue May 10, 2024 · 6 comments
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement needs milestone Awaiting prioritization for inclusion with a future NetBox release netbox status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application

Comments

@fprina
Copy link

fprina commented May 10, 2024

NetBox version

v3.7.8

Feature type

New functionality

Proposed functionality

Permits extending tag information with custom fields, as is done with other object types.

Use case

I use tags in Ansible playbook/templates and it would be great to add extra information based on them.

In the specific:

I create firewall host groups using Netbox tags, but I don't need to create groups for all the tags. I've implemented a filter in Ansible based on tag colors to distinguish them.
However, it's clear that this solution isn't well-designed.

Adding custom fields also to tags could offer more flexibility and maybe permit me to add different logics.

Database changes

No response

External dependencies

No response

@fprina fprina added status: needs triage This issue is awaiting triage by a maintainer type: feature Introduction of new functionality to the application labels May 10, 2024
@jeffgdotorg
Copy link
Contributor

Thank you for your interest in improving NetBox. We need more detail before we can consider implementing this request.

Please edit the issue body to expand your use case with Ansible usage examples showing how the proposed functionality would be used. The YAML example from the netbox.netbox.netbox_tag module docs might make a good starting point, but examples adapted from your own plays are also great.

@jeffgdotorg jeffgdotorg added the status: revisions needed This issue requires additional information to be actionable label May 13, 2024
@jeffgdotorg
Copy link
Contributor

@fprina the revisions are a good start and I thank you for making them, but I need you to make a more concrete case. You need to sell a developer on the idea of spending an hour or two doing this work. Perhaps use a sanitized version of one of your existing plays as a starting point, and show how you imagine this enhancement would improve things and make your life (and other users' lives!) easier.

@jeremystretch jeremystretch changed the title Custom field for TAG objects Custom field for tags May 14, 2024
@fprina
Copy link
Author

fprina commented May 14, 2024

@jeffgdotorg, I understand your point, but in this case, I don't really have concrete details able to sell the idea.

My playbook is quite basic, just a lookup like
{{ query('netbox.netbox.nb_lookup', 'tags', api_endpoint=netbox_url, token=netbox_token, api_filter='color=00bcd4' ) }}

but it would be better to use a clearer filter.

For example, a boolean like cf_firewall_group=true would be great.
Or maybe I could extend my implementation adding a text field with the firewall group name.

The recap is: looks like the only object type without CF are tag so would be nice have them. nothing more nothing less.

@jeremystretch jeremystretch removed the status: needs triage This issue is awaiting triage by a maintainer label May 15, 2024
@jeffgdotorg
Copy link
Contributor

The completeness argument suffices to move your issue along to needs owner status. If you would like to volunteer to work it through to a PR, please indicate and a maintainer will assign the issue to you. Otherwise, another developer with the requisite skills and capacity can pick it up.

@jeffgdotorg jeffgdotorg added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: revisions needed This issue requires additional information to be actionable labels May 15, 2024
@jeffgdotorg jeffgdotorg removed their assignment May 15, 2024
@jeremystretch
Copy link
Member

This would effect an API change for the Tag model, and therefore needs a milestone designation.

@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release status: backlog Awaiting selection for work complexity: medium Requires a substantial but not unusual amount of effort to implement and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels May 16, 2024
@goteamkor
Copy link

This would be a great addition. The ability to add custom fields to tags might also address the need for the following plugin : https://plugin-ideas.netbox.dev/ideas/PLUGINS-I-31

Rather than needing to create the plugin at all, or add a bunch of new models, you could simply 'tag' a device with a "contract" then add what ever custom fields for that tag that are appropriate for your environment/use case.

@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement needs milestone Awaiting prioritization for inclusion with a future NetBox release netbox status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants