# problem meta: end\_play  with when conditional

**URL:** <https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658>\
**Category:** Ansible Project\
**Created:** [February 12, 2019, 4:11pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658 "2019-02-12T16:11:57Z")\
**Posts on this page:** 6\
**Page:** 1

<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 12, 2019, 4:11pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/1 "2019-02-12T16:11:57Z")

</div>

Hi all,

I have a problem, i think there is a bug in ansible 2.8.0 but when i run this task :

- pause:  
prompt: “Voulez-vous effectuer ce deploiement ? (o/n)”  
register: response

- debug:  
msg: “deploiement effectue”  
when: response == “o”

- meta: end\_play  
when: response != “o”

The condition **when: response != “0”** not works !!

So, when i grab “o” for answer at the question **“Voulez-vous effectuer ce deploiement ? (o/n)”,** this task is play or he must exit !!

Why ?

Thank for your help guy !! 🙂

---

<div class="post-metadata">

**Author:** ![Pcis1](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Pcis1](https://forum.ansible.com/u/Pcis1)\
**Post date:** [February 12, 2019, 4:14pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/2 "2019-02-12T16:14:34Z")

</div>

Could you show me what it does when you run it?

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [February 12, 2019, 4:50pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/3 "2019-02-12T16:50:44Z")

</div>

Perhaps because you don't read the documentation and instead said there's a bug 😉  
You asks a lot of questions in little time on the list, try a little bit to learn by yourself

A little more functionning sample should probably be :

- hosts: localhost  
&nbsp;&nbsp;&nbsp;tasks:

&nbsp;&nbsp;&nbsp;- name: "Prompt it"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prompt: "Voulez-vous effectuer ce deploiement ? (o/n)"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: response

&nbsp;&nbsp;&nbsp;- name: "Print value of register"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "print value of register : {{ response }}"

&nbsp;&nbsp;&nbsp;- name: "Affiche si o est presse"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "deploiement effectue"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when: response.user\_input == "o"

&nbsp;&nbsp;&nbsp;- name: "Aller a la fin si o n est pas presse"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meta: end\_play  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when: response.user\_input != "o"

&nbsp;&nbsp;&nbsp;- name: "This is something after it"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "Print it"

Regards,

JYL

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [February 12, 2019, 4:53pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/4 "2019-02-12T16:53:08Z")

</div>

And by the way, ansible 2.8.0 did'nt seem to exist yet... version 2.7.7 is the last stable release

Regards,

JYL

---

<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 12, 2019, 4:59pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/5 "2019-02-12T16:59:04Z")

</div>

Thank you very much Jean-Yves,

But i don’t have a time, i must find solutions quickly.

And Documentation Ansible is so big and it’s so difficult for find solution in this documentation.  
When i write in recherche documentation ansible exemple “when”, it’s don’t works recherche 😕

Thank you !

---

<div class="post-metadata">

**Author:** ![Pcis1](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Pcis1](https://forum.ansible.com/u/Pcis1)\
**Post date:** [February 12, 2019, 5:00pm UTC](https://forum.ansible.com/t/problem-meta-end-play-with-when-conditional/29658/6 "2019-02-12T17:00:54Z")

</div>

I might be able to help you... If you can send the result of the code here
