Mitigate very long ansible-playbook runs

I’m working on a project where typical ansible-playbook runs take a considerable amount of time - 3 hours at least, to refresh a small test environment. Be under no illusion we’re “doing it right” - we’re not. None the less, I’m tasked with making it all go faster, and I’m not in a position to change the architecture significantly.

I’m thinking of coming up with a process that compares a previously generated “state file” with the target host, using checksums on files handled by ansbile, git sha’s from the role repository and the playbook repository, evaluation ansible-playbook version and extra-vars supplied on the command line. This would result in a bunch of either tags or skip-tags, in turn applied to ansible-playbook. It would be implemented as a wrapper script that will execute ansible-playbook.

Does something like this exist?

If you have an opinion on this approach, please share. I’m thick skinned.

You might want to check out Mitogen[1], depending on why your playbook is slow you might get considerable speedup.

[1] https://networkgenomics.com/ansible/

I would look at this post
https://www.ansible.com/blog/ansible-performance-tuning

Also check the latest versions of Ansible, we have been removing a lot
of bottlenecks.