# Calling a Role within a Role with multiple times and with each time a different values

**URL:** <https://forum.ansible.com/t/calling-a-role-within-a-role-with-multiple-times-and-with-each-time-a-different-values/35719>\
**Category:** Ansible Developer\
**Created:** [September 9, 2021, 4:12pm UTC](https://forum.ansible.com/t/calling-a-role-within-a-role-with-multiple-times-and-with-each-time-a-different-values/35719 "2021-09-09T16:12:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Som\_Das](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Som\_Das](https://forum.ansible.com/u/Som_Das)\
**Post date:** [September 9, 2021, 4:12pm UTC](https://forum.ansible.com/t/calling-a-role-within-a-role-with-multiple-times-and-with-each-time-a-different-values/35719/1 "2021-09-09T16:12:12Z")

</div>

Hi All,

I need to call a Ansible role Multiple times within a role and each time I need to pass different set of values via extra vars.

Anybody has any solution to it?

Regards,  
Somarko Das

---

<div class="post-metadata">

**Author:** ![Didier\_BOURRIAUD](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@Didier\_BOURRIAUD](https://forum.ansible.com/u/Didier_BOURRIAUD)\
**Post date:** [September 9, 2021, 4:19pm UTC](https://forum.ansible.com/t/calling-a-role-within-a-role-with-multiple-times-and-with-each-time-a-different-values/35719/2 "2021-09-09T16:19:01Z")

</div>

Hi,

To do that, I think you need to call it with the module “[include\_role](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_role_module.html)” in the tasks. This is called [Dynamic Reuse](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#including-roles-dynamic-reuse).

Example :

---

<div class="post-metadata">

**Author:** ![Som\_Das](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Som\_Das](https://forum.ansible.com/u/Som_Das)\
**Post date:** [September 9, 2021, 4:30pm UTC](https://forum.ansible.com/t/calling-a-role-within-a-role-with-multiple-times-and-with-each-time-a-different-values/35719/3 "2021-09-09T16:30:03Z")

</div>

Hi Didier,

Thanks for the prompt reply,

This is where we are statically passing, I mean this is hardcoded, the values but in my scenario end-user will decide what values to pass

Thanks & Regards,  
Som Das
