# Pre\_tasks using best practices layout

**URL:** <https://forum.ansible.com/t/pre-tasks-using-best-practices-layout/15643>\
**Category:** Ansible Project\
**Created:** [July 10, 2014, 2:42pm UTC](https://forum.ansible.com/t/pre-tasks-using-best-practices-layout/15643 "2014-07-10T14:42:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fokeyjo](https://avatars.discourse-cdn.com/v4/letter/f/ed8c4c/32.png) [@fokeyjo](https://forum.ansible.com/u/fokeyjo)\
**Post date:** [July 10, 2014, 2:42pm UTC](https://forum.ansible.com/t/pre-tasks-using-best-practices-layout/15643/1 "2014-07-10T14:42:10Z")

</div>

Hiya,

Hopefully this is an easy quick question… I’m using the layout described in [http://docs.ansible.com/playbooks\_best\_practices.html](http://docs.ansible.com/playbooks_best_practices.html).

I want to define a pre-task to a role defined in meta/main.yml, but I can’t seem to do it. If my tasks/main.yml looks like this:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 11, 2014, 10:26pm UTC](https://forum.ansible.com/t/pre-tasks-using-best-practices-layout/15643/2 "2014-07-11T22:26:33Z")

</div>

Ansible roles don’t have a way of defining pre and post tasks.

They are usually defined as a way to do things before applying generic tasks/roles, like load balancing, and it would be a little confusing to have them in the list of roles when some steps would be executed out of order.
