Using dependency graphs to speed up ansible?

236 views
Skip to first unread message

Kevin Burton

unread,
Dec 11, 2014, 2:48:30 PM12/11/14
to ansible...@googlegroups.com
Has anyone done any work on using dependency graphs to speed up ansible.

For example, if I have one big site.yml, and I only change an edge role, something small, it doesn't make sense to re-run ALL playbooks.

There might be situations where this makes sense.  There might be some API dependencies though but maybe you could hard code some exemptions for dependency computation.

This is generally how incremental compilers work btw.  No sense recompiling your whole app if dependencies haven't changed.

James Cammarata

unread,
Dec 11, 2014, 3:18:17 PM12/11/14
to ansible...@googlegroups.com
Hi Kevin, 

This is probably something better suited for ansible-devel, however to answer your question we do already provide several methods for limiting the scope of playbook runs (--tags, --start-at-task, --step, etc.). Ansible is really very linear, even when considering role dependencies (we compile everything down into a single list of tasks, and iterate through that), so there's no crazy dependency resolution to fix.

Also, there is the added complication that things on remote targets may have changed, so in general you would not want to automatically limit the execution of a playbook to only those parts of the play which have changed on the controlling machine.

While your suggestion might be technically possible, it definitely seems overly complex for what Ansible does. If you only need to re-run a single role or even a small subset of tasks, it is pretty trivial to create a new playbook to do so.

Thanks!


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0ba85b46-00fc-426c-87ea-7ba54a8cc585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
Dec 11, 2014, 3:24:18 PM12/11/14
to ansible...@googlegroups.com
Yep, I would highly recommend tags to reference just the stuff you changed.

There is nothing that is going to monitor what files you edited automatically - that's a bit too complex of a problem and not a use case we're interested in.




Reply all
Reply to author
Forward
0 new messages