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,080 points
435 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 35,750 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,520 points
179 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,520 points
76 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,520 points
2,779 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,520 points
20 views
+13 votes
2 answers
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
• 35,750 points
121 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.