Execute tasks on multiple hosts in parallel which fall under different group

18 views
Skip to first unread message

Shwetha Hadimani

unread,
Jul 6, 2016, 9:29:55 AM7/6/16
to Ansible Project
Hi,

I want to execute tasks on multiple hosts in parallel which fall under different group. I have a host file which looks like below,

[groupa]
10.0.1.29

[groupb]
10.0.1.45

[groupc]
10.0.1.56

My playbook looks like below,

---
  - hosts: groupa
    roles:
      - role : role1

  - hosts: groupb
    roles: 
      - role: role2

   - hosts: groupc
     roles: 
       - role: role3

I feel this structure will execute sequentially, but I want to run different tasks on groupa, groupb and groupc but at the same time

                 | ---- groupa ---- task1
playbook -- | ---- groupb ---- task2
                 | ---- groupc ---- task3

Is this kind of parallel execution possible through ansible. 

Thank you.

Reply all
Reply to author
Forward
0 new messages