# what is set\_when\_task\_skipped=false replacment in ansible 2.9?

**URL:** <https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844>\
**Category:** Ansible Project\
**Created:** [May 4, 2020, 6:16pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844 "2020-05-04T18:16:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meir\_Yanovich](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Meir\_Yanovich](https://forum.ansible.com/u/Meir_Yanovich)\
**Post date:** [May 4, 2020, 6:16pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/1 "2020-05-04T18:16:15Z")

</div>

i have old code which use set\_when\_task\_skipped=false in register  
now it is not supported any more  
I’m getting on :

`

- name: Find location  
register: login\_app set\_when\_task\_skipped=false  
when: result.stat.exists == True  
`

`  
fatal: [10.0.4.211]: FAILED! =\>  
msg: ‘Invalid variable name in ‘‘register’’ specified: ‘login\_app set\_when\_task\_skipped=false’’’

`

---

<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:** [May 4, 2020, 6:19pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/2 "2020-05-04T18:19:25Z")

</div>

To my knowledge, that has in the past created a literal variable named `login_app set_when_task_skipped=false`

`set_when_task_skipped` isn’t a feature of Ansible.

We’ve recently made some changes to ensure that variables are legal. Likely you just want:

`register: login_app`

---

<div class="post-metadata">

**Author:** ![Meir\_Yanovich](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Meir\_Yanovich](https://forum.ansible.com/u/Meir_Yanovich)\
**Post date:** [May 4, 2020, 6:49pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/3 "2020-05-04T18:49:46Z")

</div>

Then it failed when I remove it and when  
The register var is not set ,  
So basically what is the right way to do it ?  
The same function set\_when\_task\_skipped=false  
Did

---

<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:** [May 4, 2020, 6:56pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/4 "2020-05-04T18:56:58Z")

</div>

set\_when\_task\_skipped=false is not a feature of Ansible and has never done anything.

I see a stackoverflow post seeming to indicate it was a feature. However, that is incorrect.

Whatever you expected it to do, never worked to begin with.

---

<div class="post-metadata">

**Author:** ![Meir\_Yanovich](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Meir\_Yanovich](https://forum.ansible.com/u/Meir_Yanovich)\
**Post date:** [May 4, 2020, 7:01pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/5 "2020-05-04T19:01:45Z")

</div>

Maybe it was experimental plug in …

---

<div class="post-metadata">

**Author:** ![Meir\_Yanovich](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Meir\_Yanovich](https://forum.ansible.com/u/Meir_Yanovich)\
**Post date:** [May 4, 2020, 8:48pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/6 "2020-05-04T20:48:36Z")

</div>

as i see it used to be or it merged and then removed  
[https://github.com/ansible/ansible/pull/8062](https://github.com/ansible/ansible/pull/8062)

---

<div class="post-metadata">

**Author:** ![Meir\_Yanovich](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Meir\_Yanovich](https://forum.ansible.com/u/Meir_Yanovich)\
**Post date:** [May 4, 2020, 9:16pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/7 "2020-05-04T21:16:38Z")

</div>

basically, after looking into the entire internet again when regarding to ansible i see that there is no info or no simple answer on :  
"how to not set the register variable when the task is skipped "  
so what is the standard way ?

---

<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:** [May 4, 2020, 9:18pm UTC](https://forum.ansible.com/t/what-is-set-when-task-skipped-false-replacment-in-ansible-2-9/32844/8 "2020-05-04T21:18:56Z")

</div>

There is no way to prevent registering if the task is skipped.

You should register to different variable names to avoid overwriting.
