Can we run parallel jobs in Ansible

0 votes
Aug 4, 2019 in Ansible by Rajendra
• 510 points

retagged Aug 5, 2019 by Kalgi 5,097 views

1 answer to this question.

+1 vote

Running parallel tasks in Ansible is not a problem. Ansible or in fact any kind of configuration management tool was meant for this. They are suppossed to be provisioning multiple host systems simultaneously and hence parallel execution of jobs is one of their strengths. 

You can achieve the parallel execution of tasks on Ansible by just using a keyword called 'serial' in the following manner:

- name: test play
  hosts: webservers
  serial: 2
  gather_facts: False
  tasks:
  - name: task one
    command: hostname
  - name: task two
    command: hostname
answered Aug 5, 2019 by Kalgi
• 52,350 points

Related Questions In Ansible

0 votes
1 answer

Run Ansible adhoc commands in sequence

Hey @Thomas, by default ansible runs these ...READ MORE

answered Jan 14, 2019 in Ansible by Barbara
1,582 views
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17, 2019 in Ansible by Nicolas
15,668 views
0 votes
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
0 votes
1 answer

what is the difference between tags and delegate_to in ansible?

Hey @Rajendra, If you wish to perform ...READ MORE

answered Sep 24, 2019 in Ansible by Kalgi
• 52,350 points
1,918 views
0 votes
1 answer

One loop over multiple Ansible tasks

With_items has unfortunately stopped but it’s coming ...READ MORE

answered Jul 23, 2018 in Ansible by Kalgi
• 52,350 points
3,362 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP