# Ansible task execution until it completes

**URL:** <https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131>\
**Category:** Ansible Project\
**Created:** [June 20, 2023, 4:48pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131 "2023-06-20T16:48:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 20, 2023, 4:48pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/1 "2023-06-20T16:48:22Z")

</div>

Dear All,

Could you please help with the below query.

I have **variable\_data** which contains 3 records. I want to keep run **debug** task continuously every 1 minute until **percent\_complete** == 100 and then complete task execution.

Please help to achieve my requirement. Thank you in advance.

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [cluster1] =\> {  
“variable\_data.msg”: {  
“num\_records”: 3,  
“records”: [  
{  
“percent\_complete”: 20,  
“state”: “in-progress”,  
“volume”: “vol1”,  
“vserver”: “svm1”  
},  
{  
“percent\_complete”: 50,  
“state”: “in-progress”,  
“volume”: “vol2”,  
“vserver”: “svm1”  
},  
{  
“percent\_complete”: 80,  
“state”: “in-progress”,  
“volume”: “vol3”,  
“vserver”: “svm2”  
}  
]  
}  
}

---

<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:** [June 20, 2023, 4:51pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/2 "2023-06-20T16:51:26Z")

</div>

This is not possible, because percent\_complete is only 20, 60, or 80.

100 is not there. So whatever this means, it won’t finish.

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 20, 2023, 5:00pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/3 "2023-06-20T17:00:07Z")

</div>

I have another task (which will run long time) top of it where based on that this **percent\_complete** will be changed and that date stored in **variable\_data**.

I want to run **debug** task every 1 min to check percent\_complete and if records shows percent\_complete is 100 and then exit the play.

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 20, 2023, 6:26pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/4 "2023-06-20T18:26:42Z")

</div>

The play **(debug)** should execute every 1min and **percent\_complete** will get changed every time till 100.

When **percent\_complete** is reached 100 for every record in the **variable\_data** , the play should exit.

Please help to achieve. Thank You.

---

<div class="post-metadata">

**Author:** ![Kosala\_Atapattu1](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@Kosala\_Atapattu1](https://forum.ansible.com/u/Kosala_Atapattu1)\
**Post date:** [June 20, 2023, 8:02pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/5 "2023-06-20T20:02:20Z")

</div>

Have you tried something like following?

- name: wait for a url to work  
ansible.builtin.get\_url:  
url: “[https://myservice/](https://myservice/)”  
dest: “/tmp/”  
register: result  
retries: 10  
delay: 6  
until: result.rc == 0

SInce your record is a json you should be able to pull that off easily.

Cheers,

---

<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:** [June 21, 2023, 6:36am UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/6 "2023-06-21T06:36:18Z")

</div>

Given the list for testing

&nbsp;&nbsp;variable\_data:  
&nbsp;&nbsp;&nbsp;&nbsp;- {percent\_complete: 100, volume: vol1, vserver: svm1}  
&nbsp;&nbsp;&nbsp;&nbsp;- {percent\_complete: 100, volume: vol2, vserver: svm1}  
&nbsp;&nbsp;&nbsp;&nbsp;- {percent\_complete: 100, volume: vol3, vserver: svm2}

a task will complete when all \*percent\_complete\* == 100

&nbsp;&nbsp;data\_done: "{{ variable\_data|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selectattr('percent\_complete', 'ne', 100)|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;length == 0 }}"

Without knowing the source of \*variable\_data\* it's not possible to  
tell you how such a task should look like. Generally, you should test  
\*data\_done\*, set delay, and how many times you want to retry

&nbsp;&nbsp;until: data\_done  
&nbsp;&nbsp;delay: 60  
&nbsp;&nbsp;retries: 999

See "Retrying a task until a condition is met\*  
[https://docs.ansible.com/ansible/latest/playbook\_guide/playbooks\_loops.html#retrying-a-task-until-a-condition-is-met](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#retrying-a-task-until-a-condition-is-met)

Moving forward you should briefly describe at least: the inventory,  
the source of the items(tasks, processes, ...) to be completed, and  
how you consolidate \*variable\_data\*.

Make it "Minimal reproducible example". See  
[https://en.wikipedia.org/wiki/Minimal\_reproducible\_example](https://en.wikipedia.org/wiki/Minimal_reproducible_example)

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 21, 2023, 11:08am UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/7 "2023-06-21T11:08:16Z")

</div>

Hi Vladimir,

Per suggestion, i have added the mentioned variable but still something is missing and i got below error:

The conditional check ‘data\_done’ failed. The error was: Unexpected templating type error occurred on ({{ variable\_data| selectattr(‘percent\_complete’, ‘ne’, 100) | length == 0 }}): object of type ‘generator’ has no len()

Could you please assist? Thank you

This playbook is for NetApp storage module. moule ‘ **na\_ontap\_volu\*\*\*\*me** ’ using for moving volume data from one aggregate(pool) to another.  
Once ‘Volume move’ task is executed, I need to keep checking the status of volume move until 100% completed ( percent\_complete ) in the list.

---

<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:** [June 21, 2023, 4:29pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/8 "2023-06-21T16:29:35Z")

</div>

Add the explicit conversion to \*list\*

&nbsp;&nbsp;data\_done: "{{ variable\_data|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selectattr('percent\_complete', 'ne', 100)|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list\>length == 0 }}"

This has already been fixed. If you can update the latest version.

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 21, 2023, 5:59pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/9 "2023-06-21T17:59:46Z")

</div>

Hi Vladimir,

Thank you.

I will check in higher version and update the status how it works.

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 21, 2023, 7:34pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/10 "2023-06-21T19:34:21Z")

</div>

Hi Vladimir,

I have added **|list** and execute below task in ansible [core 2.11.12] but no luck. Not getting where is stopping.

**Error:**

TASK [set\_fact] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [10.250.198.160]: FAILED! =\> {}

MSG:

The task includes an option with an undefined variable. The error was: ‘ansible.utils.unsafe\_proxy.AnsibleUnsafeText object’ has no attribute ‘percent\_complete’

The error appears to be in ‘/home/u630850/facts/netapp\_volume\_move.yml’: line 48, column 19, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- debug: var=variable\_data  
^ here

There appears to be both ‘k=v’ shorthand syntax and YAML in this task. Only one syntax may be used.

**Playbook as previously mentioned:**

---

<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:** [June 21, 2023, 10:39pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/11 "2023-06-21T22:39:39Z")

</div>

Try the tasks below. Register the \*variable\_data\* in the first task  
and use it in the starting \*until\* condition of the second task. You  
want to repeat it every 1 minute. Set \*delay\* 60 seconds and \*retry\*  
for example 60 times (1 hour)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- netapp.ontap.na\_ontap\_rest\_cli:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<\<: \*login  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hostname: "{{ inventory\_hostname }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command: 'volume/move?fields=percent-complete,state'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;volume: '\*'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vserver: '\*'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;verb: 'GET'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: variable\_data

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- netapp.ontap.na\_ontap\_rest\_cli:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<\<: \*login  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hostname: "{{ inventory\_hostname }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command: 'volume/move?fields=percent-complete,state'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;volume: '\*'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vserver: '\*'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;verb: 'GET'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: variable\_data  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until: variable\_data.msg.records|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selectattr('percent\_complete', 'ne', 100)|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list\>length == 0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delay: 60  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retry: 60

This way you are actually monitoring the volumes. But, Ansible can't  
provide you with any intermediate data. The task is running on the  
remote host and you'll see the results once the task completes and  
returns the results to the controller.

Try to configure NetApp system monitors if you want to see any  
progress . See  
[https://docs.netapp.com/us-en/cloudinsights/task\_system\_monitors.html#monitor-descriptions](https://docs.netapp.com/us-en/cloudinsights/task_system_monitors.html#monitor-descriptions)

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 22, 2023, 10:55am UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/12 "2023-06-22T10:55:32Z")

</div>

HI Vladimir,

Thank you again.

I think that is what I am looking for but it is when running with verbosity ( -vvvv).

Could you please go through below mentioned -vvv output where i can see required output under MSG ( highlighted in blue):

Can we get output of only MSG instead of listing all other output so that i can seethe required output?

TASK [run ontap rest cli command for vol move resister variabele] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/user1/facts/netapp\_volume\_move.yml:38  
\< removed some data \>  
“attempts”: 1,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (34 retries left).Result was: {  
“attempts”: 2,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (33 retries left).Result was: {  
“attempts”: 3,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (32 retries left).Result was: {  
“attempts”: 4,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
changed: [Cluster1] =\> {  
“attempts”: 5,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
}  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘done’, ‘percent\_complete’: 100}], ‘num\_records’: 3}  
Read vars\_file ‘/home/user1/facts/cred\_file\_Privileged\_account.yml’

---

<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:** [June 22, 2023, 4:04pm UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/13 "2023-06-22T16:04:08Z")

</div>

This is the list of the records \*variable\_data.msg.records\*

I can't provide you with better answer without "Minimal reproducible  
example". [https://en.wikipedia.org/wiki/Minimal\_reproducible\_example](https://en.wikipedia.org/wiki/Minimal_reproducible_example)

---

<div class="post-metadata">

**Author:** ![AharonuReddy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aharonureddy/32/5464_2.png) [@AharonuReddy](https://forum.ansible.com/u/AharonuReddy)\
**Post date:** [June 23, 2023, 3:18am UTC](https://forum.ansible.com/t/ansible-task-execution-until-it-completes/38131/14 "2023-06-23T03:18:44Z")

</div>

Hi Team,

Greetings!

Could you please go through below mentioned -vvv output where i can see required output under MSG ( highlighted in blue):

Can we get output of only MSG instead of listing all other output so that i can seethe required output?

Thank you for your time and help.

TASK [**run ontap rest cli command for vol move resister variabele**] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/user1/facts/netapp\_volume\_move.yml:38  
\< removed some data \>  
“attempts”: 1,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (34 retries left).Result was: {  
“attempts”: 2,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (33 retries left).Result was: {  
“attempts”: 3,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
FAILED - RETRYING: run ontap rest cli command for vol move resister variabele (32 retries left).Result was: {  
“attempts”: 4,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
},  
“retries”: 36  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘healthy’, ‘percent\_complete’: 98}], ‘num\_records’: 3}  
\< removed some data \>  
changed: [Cluster1] =\> {  
“attempts”: 5,  
“changed”: true,  
“invocation”: {  
“module\_args”: {  
“body”: {},  
“cert\_filepath”: null,  
“command”: “volume/move?fields=percent-complete,state”,  
“feature\_flags”: {},  
“hostname”: “Cluster1”,  
“http\_port”: null,  
“https”: true,  
“key\_filepath”: null,  
“ontapi”: null,  
“params”: {  
“volume”: “_",  
“vserver”: "_”  
},  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“use\_rest”: “Always”,  
“username”: “user1”,  
“validate\_certs”: false,  
“verb”: “GET”  
}  
}  
}

**MSG:**

{‘records’: [{‘vserver’: ‘svm1’, ‘volume’: ‘svm1\_mp\_v3’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone2’, ‘state’: ‘done’, ‘percent\_complete’: 100}, {‘vserver’: ‘svm2’, ‘volume’: ‘user1\_test\_clone3’, ‘state’: ‘done’, ‘percent\_complete’: 100}], ‘num\_records’: 3}  
Read vars\_file ‘/home/user1/facts/cred\_file\_Privileged\_account.yml’
