# PLAY RECAP -- Status

**URL:** <https://forum.ansible.com/t/play-recap-status/29651>\
**Category:** Ansible Project\
**Created:** [February 11, 2019, 4:10pm UTC](https://forum.ansible.com/t/play-recap-status/29651 "2019-02-11T16:10:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juraj\_Papic](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Post date:** [February 11, 2019, 4:10pm UTC](https://forum.ansible.com/t/play-recap-status/29651/1 "2019-02-11T16:10:18Z")

</div>

Hi all,

I need to execute a script every time PLAY RECAP failed=1, how can I configure my Ansible Playbook to do this?

Thanks.

---

<div class="post-metadata">

**Author:** ![Stefan\_Schmid](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Stefan\_Schmid](https://forum.ansible.com/u/Stefan_Schmid)\
**Post date:** [February 11, 2019, 4:26pm UTC](https://forum.ansible.com/t/play-recap-status/29651/2 "2019-02-11T16:26:05Z")

</div>

Check Ansible block. It has a rescue section.

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [February 11, 2019, 4:33pm UTC](https://forum.ansible.com/t/play-recap-status/29651/3 "2019-02-11T16:33:14Z")

</div>

Hi Tcpip,

You must use this syntax task :

**- name: my task**  
**shell: ./my\_script**  
**when: my\_variable == “1”**

./my\_script ==\> the way of my script with a point front  
my\_variable can be PLAY\_RECAP

tell me about this solution please.

Thank you

---

<div class="post-metadata">

**Author:** ![Juraj\_Papic](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Post date:** [February 11, 2019, 7:14pm UTC](https://forum.ansible.com/t/play-recap-status/29651/4 "2019-02-11T19:14:29Z")

</div>

Hello ryad9200000,

I can this variable info at the end of my playbook so when I fails It will run the script. If I put PLAY\_RECAP ==“0” this will mean that the playbook finished ok ?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Juraj\_Papic](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Post date:** [February 11, 2019, 7:15pm UTC](https://forum.ansible.com/t/play-recap-status/29651/5 "2019-02-11T19:15:03Z")

</div>

Hello Stefan,

I will take it a look,

thanks for your help.

---

<div class="post-metadata">

**Author:** ![Juraj\_Papic](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Post date:** [February 11, 2019, 9:00pm UTC](https://forum.ansible.com/t/play-recap-status/29651/6 "2019-02-11T21:00:47Z")

</div>

This is the playbook Im using for test.

---

<div class="post-metadata">

**Author:** ![JonTheNiceGuy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jontheniceguy/32/2267_2.png) [@JonTheNiceGuy](https://forum.ansible.com/u/JonTheNiceGuy)\
**Post date:** [February 12, 2019, 6:35am UTC](https://forum.ansible.com/t/play-recap-status/29651/7 "2019-02-12T06:35:29Z")

</div>

If you spot, in the logs, it shows that it’s breaking on the “ethernet0/1”, and, if I read it right that’s in the “/” in that… So it’s probably worth wrapping any instance of “ethernet0/1” in quotes, like I did.

Give that a whirl, and try again 🙂

---

<div class="post-metadata">

**Author:** ![Juraj\_Papic](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Post date:** [February 12, 2019, 11:32am UTC](https://forum.ansible.com/t/play-recap-status/29651/8 "2019-02-12T11:32:58Z")

</div>

Hello Jon

Yes I know the issue and it was intentional, what Im trying to do is to test if this works or not.

- name: my task  
shell: ./print.py  
when: failed == ‘1’  
register: task  
tags: task

Thanks.
