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

Feature Request: Inventory Defaults Loading #723

Open
jvanderaa opened this issue Oct 8, 2021 · 4 comments
Open

Feature Request: Inventory Defaults Loading #723

jvanderaa opened this issue Oct 8, 2021 · 4 comments

Comments

@jvanderaa
Copy link

It looks like there is some common code being implemented on Nornir NetBox and Nornir Ansible inventories. Which is something that will also be implemented into the Nornir Nautobot inventory as well. This should likely become a method that is common in the Nornir library.

@jvanderaa
Copy link
Author

I can submit the request in if this would be good to go.

@dbarrosop
Copy link
Contributor

Which code are you referring to? Note that how to load inventory defaults is specific to the inventory plugin, we don't expect plugins to implement a specific mechanism. However, if people are trying to replicate what the SimpleInventory does, I am ok cleaning that driver and turning it into a public API that can be leveraged by other drivers.

@jvanderaa
Copy link
Author

I would look at having this as a method within Nornir inventory - https://github.com/wvandeun/nornir_netbox/blob/develop/nornir_netbox/plugins/inventory/netbox.py#L39-L48, it appears there on the NetBox inventory and again on the Ansible inventory - https://github.com/carlmontanari/nornir_ansible/blob/master/nornir_ansible/plugins/inventory/ansible.py#L456-L472

@dbarrosop
Copy link
Contributor

Ok, makes sense, we could have a from_dict static method on all of the public facing objects to do this magic.

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 a pull request may close this issue.

2 participants