# Mitigate very long ansible-playbook runs

**URL:** <https://forum.ansible.com/t/mitigate-very-long-ansible-playbook-runs/30683>\
**Category:** Ansible Project\
**Created:** [June 28, 2019, 9:29am UTC](https://forum.ansible.com/t/mitigate-very-long-ansible-playbook-runs/30683 "2019-06-28T09:29:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [June 28, 2019, 9:29am UTC](https://forum.ansible.com/t/mitigate-very-long-ansible-playbook-runs/30683/1 "2019-06-28T09:29:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [June 28, 2019, 5:03pm UTC](https://forum.ansible.com/t/mitigate-very-long-ansible-playbook-runs/30683/2 "2019-06-28T17:03:12Z")

</div>

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/](https://networkgenomics.com/ansible/)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 28, 2019, 5:06pm UTC](https://forum.ansible.com/t/mitigate-very-long-ansible-playbook-runs/30683/3 "2019-06-28T17:06:45Z")

</div>

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

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