One loop over multiple Ansible tasks

0 votes
I've created an Ansible playbook that creates a cloud instance and then installs some programs on the instance. I want to run this playbook multiple times (without using a bash script). What can I do as with_items seemed like it would be a good approach but too bad we cant use this anymore.
Jul 23, 2018 in Ansible by Hannah
• 18,520 points
3,362 views

1 answer to this question.

0 votes

With_items has unfortunately stopped but it’s coming up in its new versions.

You could try to work with the v2 branch from github.

What you can do with 1.9.1 is to move your tasks into a role and reference this role multiple times in your playbook.

answered Jul 23, 2018 by Kalgi
• 52,350 points

Related Questions In Ansible

0 votes
1 answer

Using multiple config files using same template in a role in ansible

Go through this include_role module: tasks: - ...READ MORE

answered Jun 5, 2018 in Ansible by DareDev
• 6,890 points
4,224 views
+1 vote
2 answers

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 14, 2018 in Ansible by DareDev
• 6,890 points
2,464 views
0 votes
1 answer

ansible playbook: using multiple variables in loops

Use an indexed hostname, and then define ...READ MORE

answered Jul 16, 2018 in Ansible by DareDev
• 6,890 points
18,988 views
0 votes
1 answer

stopping different hosts from reading the same value when usign ansible in loop

Try using this. Create a new directory ...READ MORE

answered Jul 27, 2018 in Ansible by DareDev
• 6,890 points
702 views
+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

Ansible iterate over hash with condition

Your when statement is wrong. you either split ...READ MORE

answered Jul 23, 2018 in Ansible by Kalgi
• 52,350 points
1,374 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