# BUG or Operating As Designed?

**URL:** <https://forum.ansible.com/t/bug-or-operating-as-designed/26738>\
**Category:** Ansible Project\
**Created:** [February 14, 2018, 7:48pm UTC](https://forum.ansible.com/t/bug-or-operating-as-designed/26738 "2018-02-14T19:48:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [February 14, 2018, 7:48pm UTC](https://forum.ansible.com/t/bug-or-operating-as-designed/26738/1 "2018-02-14T19:48:32Z")

</div>

I have the following playbook:

`

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 14, 2018, 8:13pm UTC](https://forum.ansible.com/t/bug-or-operating-as-designed/26738/2 "2018-02-14T20:13:58Z")

</div>

A play encompasses `pre_tasks`, `roles`, `tasks`, and `post_tasks`. You are expecting it to end the role.

Perhaps you should instead move all subsequent tasks of that role into a block or another file and use include\_tasks, and then apply the `when` statement to that (but reverse the logic).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 14, 2018, 8:32pm UTC](https://forum.ansible.com/t/bug-or-operating-as-designed/26738/3 "2018-02-14T20:32:19Z")

</div>

a way to do this is having a block on whole role and a rescue that  
checks for the error, which allows you to make a 'skip rest' kind  
facility.
