Ansible privilege escalation once per play

Doing privilege escalation only onces per play is possible by utilizing Mitogen for Ansible.

From their documentation:

One connection is used per target, in addition to one sudo invocation per user account. This is much better than SSH multiplexing combined with pipelining, as significant state can be maintained in RAM between steps, and system logs aren’t spammed with repeat authentication events.

Mitogen also provides additional performance benefits for running plays, such as reuse of Python interpreters.

It is however not compatible with all Ansible configurations as it replaces significant parts of Ansible! Their documentation lists noteworthy differences to vanilla Ansible, some of which might require changes to playbooks or might make using it completely unfeasible.