ansible_modules icon indicating copy to clipboard operation
ansible_modules copied to clipboard

[Feature]: Allow altering several elements in one call

Open mathieu-mp opened this issue 4 years ago • 5 comments

ISSUE TYPE
  • Feature Idea
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 avatar Apr 23 '21 18:04 mathieu-mp

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

mathieu-mp avatar Apr 23 '21 18:04 mathieu-mp

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.

FragmentedPacket avatar May 09 '21 02:05 FragmentedPacket

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

sc68cal avatar Aug 09 '21 17:08 sc68cal

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!!!

drobnymichal avatar Sep 13 '23 04:09 drobnymichal

The issue is still open, contributions are welcome

sc68cal avatar Sep 13 '23 20:09 sc68cal