Greetings,
I'd like to take a list (of varying size) and split it into a list of lists, where each sub-list is at most N elements. I'm not certain where to start on this one. Advice welcome.
The background is that I've got a dynamically built list of packages for installation. For Centos 6.x, if the list is too large, the yum module will fail out, reporting "ValueError: filedescriptor out of range in select()". I'd like to split the large list into sub-lists, and process each sub-list with separate yum tasks. I'm not clear how I can use Jinja / Ansible to build that list of lists. I figure if I can craft the list of lists, I can use with_items on an include, where the include file will run the yum install on one sub-list at a time.
I'm open to other approaches on how to solve the problem.
Thanks,
Ed