# Ansible execution workflow

**URL:** <https://forum.ansible.com/t/ansible-execution-workflow/22254>\
**Category:** Ansible Project\
**Created:** [August 9, 2016, 11:31pm UTC](https://forum.ansible.com/t/ansible-execution-workflow/22254 "2016-08-09T23:31:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![knowshan](https://avatars.discourse-cdn.com/v4/letter/k/e9a140/32.png) [@knowshan](https://forum.ansible.com/u/knowshan)\
**Post date:** [August 9, 2016, 11:31pm UTC](https://forum.ansible.com/t/ansible-execution-workflow/22254/1 "2016-08-09T23:31:39Z")

</div>

I was wondering if there is any documentation available that describes how Ansible works or provides any architecture diagram. I am assuming general steps in Ansible execution are:

- Establish SSH connection with a remote host
- Copy Ansible modules, roles and playbooks to the remote host
- Gather all facts on the remote host
- Compile Jinja2 templates on the remote host
- Run playbook tasks

Any documentation that describes such execution workflow would be helpful in understanding Ansible.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 10, 2017, 3:13am UTC](https://forum.ansible.com/t/ansible-execution-workflow/22254/2 "2017-02-10T03:13:04Z")

</div>

Nothing up 2 date, but here is a quick rundown:

- read plays/roles  
- read inventory  
- start tasks execution  
&nbsp;&nbsp;- gather facts if set  
&nbsp;&nbsp;- execute rest of tasks  
&nbsp;&nbsp;- execute handlers if needed

As for task execution (gather facts is just another task):  
&nbsp;&nbsp;- compile task, template and assign variables  
&nbsp;&nbsp;- copy module + arguments to target  
&nbsp;&nbsp;- execute module on target  
&nbsp;&nbsp;- process results from module output

There are exceptions to this and many more moving parts, but that is  
mostly the gist of it.

---

<div class="post-metadata">

**Author:** ![Dani\_C](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Dani\_C](https://forum.ansible.com/u/Dani_C)\
**Post date:** [February 11, 2017, 7:33am UTC](https://forum.ansible.com/t/ansible-execution-workflow/22254/3 "2017-02-11T07:33:53Z")

</div>

Brian,

the info is gold mine, where would you think it might fit in the docs? (i’d love to see this added and maybe extended. coming from Salt land this info does help big time)

cheers
