# Need help in polling the ansible task

**URL:** <https://forum.ansible.com/t/need-help-in-polling-the-ansible-task/33358>\
**Category:** Ansible Project\
**Created:** [July 9, 2020, 9:26am UTC](https://forum.ansible.com/t/need-help-in-polling-the-ansible-task/33358 "2020-07-09T09:26:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rahul\_Kumar1](https://forum.ansible.com/u/Rahul_Kumar1)\
**Post date:** [July 9, 2020, 9:26am UTC](https://forum.ansible.com/t/need-help-in-polling-the-ansible-task/33358/1 "2020-07-09T09:26:15Z")

</div>

Hi Geeks ,  
I have a task as below which returns me some data. I want to continuously poll this request until I get a specific attribute in response as true.  
Here is the response from the playbook sample1.yml:

{“\_id”:“89494fnfi04m0”,“price”:“$17”,“isFetched”: false}

cat sample1.yml

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [July 9, 2020, 7:44pm UTC](https://forum.ansible.com/t/need-help-in-polling-the-ansible-task/33358/2 "2020-07-09T19:44:36Z")

</div>

You can register it and use retries until it gets something you want . The. You can call you second playbook with your when condition .

You have to provide the exact output to get condition .

Until: register.somthing.isFetched == true

---

<div class="post-metadata">

**Author:** ![Rahul\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rahul\_Kumar1](https://forum.ansible.com/u/Rahul_Kumar1)\
**Post date:** [July 10, 2020, 5:36am UTC](https://forum.ansible.com/t/need-help-in-polling-the-ansible-task/33358/3 "2020-07-10T05:36:34Z")

</div>

Thanks Vinoth ! Once i put condition like that:  
until: result[‘results’][0].content.isFetched == True

It says  
“msg”: “The conditional check ‘result[‘results’][0].content.isFetched == True’ failed. The error was: error while evaluating conditional (result[‘results’][0].content.isFetched == True): ‘dict object’ has no attribute ‘results’”

But in next task if i print same thing:

- name: Print Response of status resource  
debug:  
msg: “Boss Version: {{ result[‘results’][0].content.isFetched }}”

It gives me output:  
“msg”: “Boss Version: True”  
I am not sure how until works , does it wait till some condition becomes true with continuous polling ?

Regards  
Rahul
