You mean something like this?

    - name: Run status check 
      pps_check:
        vm_ip: "{{ item }}"
        url: 
"https://bldrapp.sys.comcast.net/api/v3/hosts/status?host-list=";
      register: status_check
      with_items: "{{ available_ips }}"
      async: 900  # Adjust the timeout based on the expected maximum time 
to complete the task (15 minutes)
      poll: 0
      tags:
        - pps-status

    - name: Wait for all tasks to complete
      async_status:
        jid: "{{ item.ansible_job_id }}"
      register: job_result
      until: job_result.finished
      retries: 30  # Adjust as needed
      delay: 60    # Adjust as needed
      with_items: "{{ status_check.results }}"
      tags:
        - pps-status

    - name: Gather results
      set_fact:
        all_results: "{{ all_results | default([]) + [item] }}"
      loop: "{{ job_result.results }}"
      tags:
        - pps-status

On Thursday, May 2, 2024 at 5:36:48 AM UTC-6 Thirumalai Raja A wrote:

> HI TEAM,
>
> below is my task to check the job completed status for the set of ips, and 
> for an ip approximately taking 15 mins to get the status. if i am having 5 
> number of ips its taking too long to complete my task.
>
> so i am looking for parallel options to check for this particular task. is 
> is passible to do that?
> if yes can anyone guide me pls.
>
>
>     - name: PPS Playbook Status
>       pps_check:
>         vm_ip: "{{ item }}"
>         url: "
> https://bldrapp.sys.comcast.net/api/v3/hosts/status?host-list=";
>       register: status_check
>       with_items: "{{available_ips}}"
>       tags:
>         - pps-status
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6cca0856-c720-4f98-a5f2-63e5b2ee9083n%40googlegroups.com.

Reply via email to