# handling stderr

**URL:** <https://forum.ansible.com/t/handling-stderr/25729>\
**Category:** Ansible Project\
**Created:** [October 12, 2017, 8:16am UTC](https://forum.ansible.com/t/handling-stderr/25729 "2017-10-12T08:16:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhijit\_Chakraborty](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Abhijit\_Chakraborty](https://forum.ansible.com/u/Abhijit_Chakraborty)\
**Post date:** [October 12, 2017, 8:16am UTC](https://forum.ansible.com/t/handling-stderr/25729/1 "2017-10-12T08:16:18Z")

</div>

I have a playbook with the following contents

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 12, 2017, 9:24am UTC](https://forum.ansible.com/t/handling-stderr/25729/2 "2017-10-12T09:24:01Z")

</div>

When: is executed first and at this time output is not populated since command has not run yet.

You need to split it in two tasks, one that check and one that create with the result that you don't need the handler.
