Hello,

Is it possible in Ansible to loop over multiple tasks?

Something like:

    - loop: "{{ mylist }}"

      - name: Task 1
        do something with item step 1

      - name: Task 2
        do something with item step 2

      - name: Task 3
        do something with item step 3

The only way I've found to accomplish this is to call out to a tasks file 
within the loop, and include all 3 tasks there.  But it would be nicer to 
be able to do it in a single playbook.
      - name: Loop control
        include_tasks: "tasks.yml"
        loop: "{{ mylist }}"

Thanks for any feedback!


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/ca04bd24-27c9-4d43-8cb9-833672af022f%40googlegroups.com.

Reply via email to