On Tue, 20 Jun 2023 22:18:22 +0530
Aharonu <aharon...@gmail.com> wrote:

> 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.

Given the list for testing

  variable_data:
    - {percent_complete: 100, volume: vol1, vserver: svm1}
    - {percent_complete: 100, volume: vol2, vserver: svm1}
    - {percent_complete: 100, volume: vol3, vserver: svm2}

a task will complete when all *percent_complete* == 100

  data_done: "{{ variable_data|
                 selectattr('percent_complete', 'ne', 100)|
                 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

  until: data_done
  delay: 60
  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

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


-- 
Vladimir Botka

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20230621083618.30b488d1%40gmail.com.

Attachment: pgp6Ulp6wz2ka.pgp
Description: OpenPGP digital signature

Reply via email to