# 'until' loop label invisible, and not possible to customise?

**URL:** <https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201>\
**Category:** Ansible Project\
**Created:** [July 7, 2023, 9:54am UTC](https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201 "2023-07-07T09:54:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [July 7, 2023, 9:54am UTC](https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201/1 "2023-07-07T09:54:02Z")

</div>

Hii,  
I'm using the 'until' loop to wait for a condition to be true:

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [July 7, 2023, 10:48am UTC](https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201/2 "2023-07-07T10:48:59Z")

</div>

It is not, I'm afraid. The controller will see the value of \*status\*  
after the loop completes. (The condition is evaluated on the remote  
host).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 7, 2023, 4:30pm UTC](https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201/3 "2023-07-07T16:30:08Z")

</div>

> (The condition is evaluated on the remote

host).

No, conditions (as well as any templating) is always evaluated on the  
controller, the caveat is that DATA for this evaluation might come  
from the remote host. via `register:`.

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [July 7, 2023, 9:21pm UTC](https://forum.ansible.com/t/until-loop-label-invisible-and-not-possible-to-customise/38201/4 "2023-07-07T21:21:17Z")

</div>

Right. The \*task\_executor\* takes care of this  
[https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/task\_executor.py#L775](https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/task_executor.py#L775)

I was too quick. The registered variable can be used in the label. If  
the status of the task (changed) is available when the label is  
displayed the registered variable should be available as well. For  
example,

&nbsp;&nbsp;&nbsp;&nbsp;- command: "echo {{ item }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: status  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loop: [1, 2, 3, 4, 5]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loop\_control:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label: "{{ status.stdout|int + 10 }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until: status.stdout|int \< 4  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delay: 1

gives

TASK [command]
