# Blocks and roles

**URL:** <https://forum.ansible.com/t/blocks-and-roles/20207>\
**Category:** Ansible Project\
**Created:** [January 13, 2016, 11:16pm UTC](https://forum.ansible.com/t/blocks-and-roles/20207 "2016-01-13T23:16:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orderedchaosdev](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@orderedchaosdev](https://forum.ansible.com/u/orderedchaosdev)\
**Post date:** [January 13, 2016, 11:16pm UTC](https://forum.ansible.com/t/blocks-and-roles/20207/1 "2016-01-13T23:16:56Z")

</div>

I’m trying to wrap an entire role in a block does anyone have examples of this working?

---

<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:** [January 14, 2016, 10:11pm UTC](https://forum.ansible.com/t/blocks-and-roles/20207/2 "2016-01-14T22:11:51Z")

</div>

blocks are only for tasks, you can wrap all the tasks in a role's  
tasks/main.yml in a block but not the role itself
