ansible-freeipa
ansible-freeipa copied to clipboard
batch command support
While ansible-freeipa allows to have multiple IPA actions in the same block, they still submitted to IPA server separately. This causes a slowdown. Instead, a batch command from IPA API can be used to send all these commands in the same request and let IPA server to process the commands locally. This will cut down the time spent on communication.
A real life anecdotal data: deploying OpenStack infrastructure with ansible-freeipa took 4 hours, using IPA API with batch command directly completes the same action under 20 minutes.
The key culprit is the unrolling here: https://github.com/freeipa/ansible-freeipa/blob/master/plugins/module_utils/ansible_freeipa_module.py#L1403-L1426 where each IPA command is sent out separately. Instead, ansible-freeipa should repackage these commands into a list of dictionaries with the commands in them and then send that list as a single 'batch' command.
Documentation for batch command: https://freeipa.readthedocs.io/en/latest/api/batch.html (not much, admittedly) Basic usage guide: https://freeipa.readthedocs.io/en/latest/api/basic_usage.html#id9
Fixed with https://github.com/freeipa/ansible-freeipa/pull/1229