Calling URI task to 10 servers in parallel

Ansible newbie…

We run a large enterprise web app load balanced over 10 servers in a customer environment (windows servers)The app exposes a set of Webservices to manage config, such as applying new binaries, exporting config as XML etc.

Sometimes we need to update the application, and this is done by uploading a large ZIP (200mb) to each node, and sometimes we need to export the full config from each node.
Both these things can take a short while (30 secs or so)
Previously we had a set of bash scripts we ran to upload/export the zips, but it ran in a linear fashion, so the script running was 10 x the time to perform the function. It could end up taking a while.

We are now looking at Ansible, and ideally, we would want to do these upload or export tasks in parallel to minimise downtime for the client.
We have the uri-module working to call the webservices but not sure on the best way to run the 10 uri tasks in parallel?

I was thinking of calling uri with the async “call and forget, then check later” method, and just call 10 tasks, one for each node?

Something like this (the below example just runs for 2 nodes).
It looks like it might work, but i don’t like having this repetition?

Is there any other way to do this?

`

- hosts: node1,node2
   gather_facts: no

   vars:
     ohp_auth_user: "username"
     ohp_auth_password: "password"
     backup_folder: "./backups-async"

   tasks:
     - name: Export node 1 config
       uri:
         url: "https://{{ inventory_hostname}}:19043/configuration/config/export/all"
         headers:
           "accept": "application/vnd.AdminConfiguration.6_9+zip"
           "Content-Type": "application/x-www-form-urlencoded"
           "X-Requested-With": "ansible"
         method: POST
         user: "{{ ohp_auth_user }}"
         password: "{{ ohp_auth_password }}"
         force_basic_auth: yes
         validate_certs: no
         status_code: 200
         timeout: 20
         return_content: yes
         dest: "{{ backup_folder }}/{{ inventory_hostname}}_config.zip"
       delegate_to: localhost

This will do the same in parallel for node1 to node2.
Ansible run default a task in parallel on 5 hosts, but this can be adjusted with forks on command line or in ansible.cfg

Ah, many thanks. I had totally overlooked the delegate_to functionality.
A lot of the tasks I need to run in a “local” context and simply call the remote server webservices - so this delegate_to functionality is a key piece of the puzzle.

Thanks!