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
• 14,070 points
703 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
• 40,460 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,810 points
531 views
0 votes
1 answer

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 13, 2018 in Ansible by DareDev
• 6,810 points
174 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,810 points
4,410 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,810 points
37 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
150 views
0 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
• 40,460 points
187 views