# Wrapping roles inside blocks to catch failures

**URL:** <https://forum.ansible.com/t/wrapping-roles-inside-blocks-to-catch-failures/19947>\
**Category:** Ansible Project\
**Created:** [December 6, 2015, 7:46pm UTC](https://forum.ansible.com/t/wrapping-roles-inside-blocks-to-catch-failures/19947 "2015-12-06T19:46:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfc2549](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rfc2549/32/197_2.png) [@rfc2549](https://forum.ansible.com/u/rfc2549)\
**Post date:** [December 6, 2015, 7:46pm UTC](https://forum.ansible.com/t/wrapping-roles-inside-blocks-to-catch-failures/19947/1 "2015-12-06T19:46:24Z")

</div>

I love the idea around the new [block](http://docs.ansible.com/ansible/playbooks_blocks.html) feature in Ansible 2.

The example in the documentation includes tasks, I wanted to know if there was other areas/scopes in which we could include them ?

It doesn’t look like I can get my two use cases to work. Something like this (pseudo-code):

1.

---

<div class="post-metadata">

**Author:** ![tinyzais](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@tinyzais](https://forum.ansible.com/u/tinyzais)\
**Post date:** [November 20, 2016, 12:57pm UTC](https://forum.ansible.com/t/wrapping-roles-inside-blocks-to-catch-failures/19947/2 "2016-11-20T12:57:54Z")

</div>

Would like to do the same trick.  
Have you found any workaround?
