netbox-community / ansible_modules

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

[Feature]: Allow altering several elements in one call #493

Open mathieu-mp opened 3 years ago

mathieu-mp commented 3 years ago
ISSUE TYPE
SUMMARY

Each module currently allows altering only one element at a time. I would love to be able to alter several elements in one call of the module. This would allow a much faster execution for large sets of data, optimizing API calls.

EXAMPLE USE CASE

Asserting the presence of large sets of vlans inside NetBox in a decent timeframe. This is currently very time consumming due to the numerous API calls.

mathieu-mp commented 3 years ago

On a parameter point of view, this could be implemented via a new aggregate parameter which would allow a list of elements where each element matches data parameter definition (See nxos_vlan module, albeit deprecated)

Or just allow a list of elements in the existing data parameter

FragmentedPacket commented 3 years ago

I'm in maintenance mode for this repo. I'm looking for another maintainer that has more drive to deliver and maintain Ansible modules so I'll mark this as help_wanted as I'm not pouring much time into maintaining Ansible modules and looking to skill up in Django and other things at this point, but I think this would be beneficial.

I believe the slowness is mostly related to how Ansible handles looping and the aggregate may help (I haven't looked into it much). I believe NetBox can also do bulk POST operations as well or pynetbox so we could potentially make the argument specs lists to accomplish faster bulk updates. We have thought about moving these to Action plugins as well that may help speed it up as well.

sc68cal commented 3 years ago

I'm currently getting killed by this when I am using netbox_cable with a loop with a lot of cables.

drobnymichal commented 1 year ago

Please, can we reopen this issue?

I am currently struggling with adding a large number of addresses to NetBox. It would really help me to have some sort of bulk import option.

Thanks for your time!!!

sc68cal commented 1 year ago

The issue is still open, contributions are welcome