Hello everyone,

I am using delegate_to in combination with nested loop in order to create a 
custom distribution system between a group of hosts.
The problem is that the nested loop is running sequentially, meaning that 
it has firstly to finish the task in the first host before proceeding with 
the second one and so on.
That results to time consuming tasks like restoring form backup.
I was wondering if there is a way of running the loops in parallel 
(with_items, with_nested).
Below i am giving an example on how my task works:

- name: Restore from backup
  synchronize:
    src: xxxx
    dest: xxxx
  delegate_to: "{{hosts[ ( ((item[0] -1) + (item[1] | int)) - 1) % 
(hosts|length|int) ] }}"
  run_once: yes
  with_nested:
    - "{{item0}}"
    - "{{item1}}"  


-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/07aa06bc-5b6c-43d7-a0f4-a958ab577060%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to