# How do I use Ansible loop for generalizing things in a role

**URL:** <https://forum.ansible.com/t/how-do-i-use-ansible-loop-for-generalizing-things-in-a-role/31934>\
**Category:** Ansible Project\
**Created:** [January 8, 2020, 5:57pm UTC](https://forum.ansible.com/t/how-do-i-use-ansible-loop-for-generalizing-things-in-a-role/31934 "2020-01-08T17:57:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xinhuan\_Zheng](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@Xinhuan\_Zheng](https://forum.ansible.com/u/Xinhuan_Zheng)\
**Post date:** [January 8, 2020, 5:57pm UTC](https://forum.ansible.com/t/how-do-i-use-ansible-loop-for-generalizing-things-in-a-role/31934/1 "2020-01-08T17:57:25Z")

</div>

Hello,

I’m creating a Ansible role to place a set of scripts to managed hosts so that they can start by cron in a defined schedule. Since it is a set of scripts, I want to generalize the play execution sequence to use a loop. This will be before loop:

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 8, 2020, 9:34pm UTC](https://forum.ansible.com/t/how-do-i-use-ansible-loop-for-generalizing-things-in-a-role/31934/2 "2020-01-08T21:34:43Z")

</div>

Loop over a list of dicts.
