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

Provide resource for finding available interface by name #615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mraerino
Copy link
Contributor

@mraerino mraerino commented Jul 7, 2024

This resource is similar to netbox_available_ip_address as it allows creating a resource based on what other resources are present in a certain namespace.

In this case we're looking at all interfaces of a device with a certain prefix and create an interface with the lowest number suffix to a prefix so that it doesn't clash with an existing interface.

Notably, it doesn't use an existing API in Netbox to accomplish this, but instead does an API call to list the interfaces and constructs the name in the provider. This might be prone to race conditions when creating multiple interfaces for the same device with the same prefix at the same time.

@fbreckle
Copy link
Collaborator

This is absolutely an interesting feature, but I am not sure if implementing this kind of logic directly into the provider is a good pattern. Any thoughts on that?

I will postpone this until after 4.x compatibility.

@mraerino
Copy link
Contributor Author

yeah, it's debatable - i mostly just really need this functionality and it's really hard to accomplish without support in the provider. i might try to get this supported in the netbox API

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