# Is there any way to exit playbook explicitly (short-circuit) with success?

**URL:** <https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000>\
**Category:** Ansible Developer\
**Created:** [March 28, 2016, 4:34pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000 "2016-03-28T16:34:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Novikov](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Alexander\_Novikov](https://forum.ansible.com/u/Alexander_Novikov)\
**Post date:** [March 28, 2016, 4:34pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/1 "2016-03-28T16:34:15Z")

</div>

Hi everyone,

I noticed that there is an explicit fail module, but is there an explicit short-circuit success in ansible?  
Or is it always _necessary_ (I understand that it’s not preferred) to write playbooks that execute everything _and_ are idempotent?

I am trying to throw together a quick prototype for my project and would rather avoid the upfront cost of refactoring for my intents and purposes.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Mainguy](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jonathan\_Mainguy](https://forum.ansible.com/u/Jonathan_Mainguy)\
**Post date:** [March 28, 2016, 5:06pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/2 "2016-03-28T17:06:07Z")

</div>

You can use raw module to call /bin/true

---

<div class="post-metadata">

**Author:** ![Jonathan\_Mainguy](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jonathan\_Mainguy](https://forum.ansible.com/u/Jonathan_Mainguy)\
**Post date:** [March 28, 2016, 5:07pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/3 "2016-03-28T17:07:53Z")

</div>

Actually. I misread what you were asking. I think tags is what you are after. Let’s you run sections of a playbook. So it exits when done.

---

<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:** [March 28, 2016, 5:08pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/4 "2016-03-28T17:08:32Z")

</div>

you can:

fail:  
when: registered|success

---

<div class="post-metadata">

**Author:** ![Alexander\_Novikov](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Alexander\_Novikov](https://forum.ansible.com/u/Alexander_Novikov)\
**Post date:** [March 28, 2016, 6:21pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/5 "2016-03-28T18:21:18Z")

</div>

That’s going to make ansible-playbook exit with non-zero code, right? No way to exit gracefully?

---

<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:** [March 28, 2016, 9:12pm UTC](https://forum.ansible.com/t/is-there-any-way-to-exit-playbook-explicitly-short-circuit-with-success/21000/6 "2016-03-28T21:12:22Z")

</div>

no current method, IIRC there is a feature request to add this to fail
