I'm running Ansible 2.2, but can upgrade if it helps.
I saw this and was pretty excited, but it doesn't seem to be in this (or any) version of Ansible documentation.
The problem I'm trying to solve is I've got 1000 users that I need to manage on a Centos box.
It takes quite a while to run this task serially. And even more annoying, everything shows up as changed because the "expires" command on the user module always marks the thing as changed.
this also looked promising, but it took the same amount of time to run each command in the with_items loop and didn't go any faster (I never bothered to wait long enough to get to the end).
Skipping tasks is fast now (a lot faster than it was in Ansible 2.0), if I can't figure out how to make this work in parallel, I think I'll go back and figure out how to skip pointless tasks and if all else fails, I'll write my own module. But it seems like I should be able to do all this faster in Ansible.
This is what I want to run in parallel, host_authorizations is a list of usernames and other data.
- name: Create/modify OS user accounts
user: name={{ item.username }} group=sshusers shell=/bin/bash home="/home/selinux-modules/{{ item.username }}" state=present expires={{item.expiredate|default(omit)}}
with_items: "{{ host_authorizations }}"
tags: full_maintenance
– Levi Apr 12 '18 at 11:12ISSUE TYPE Feature Ideacommunity.general.locale_genmodule. I belive it went a little faster than usual, but not that much. I noticed that there was only onelocale_defprocess displayed bytop. May it be that it would take much more advantage of multiple cores or vCPUs if more processes could be spawned, one for each item in the loop? Maybe that would require more connections to be opened from the Ansible Controller to the host? – Jaume Sabater May 18 '23 at 18:23