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 : tasks: - name: "First Time" include_role: name: "my_role" vars: key1: "value" - name: "Second Time" include_role: name: "my_role" vars: key1: "Another Value" Hope this helps. -- [image: Kosmos] <https://www.kosmos-education.com/> Didier BOURRIAUD Expert Technique Tél. : 0684187621 <undefined> - 8 rue Kervégan 44000 Nantes - France [image: Twitter] <https://www.twitter.com/kosmos_fr> [image: Linkedin] <https://fr.linkedin.com/company/kosmos_2> [image: Youtube] <https://www.youtube.com/user/kosmoseducation> www.kosmos-education.com Le jeu. 9 sept. 2021 à 18:12, Som Das <somarko1...@gmail.com> a écrit : > 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-devel+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-devel/9afce483-e5eb-45c4-86d8-af9312f10fe7n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-devel/9afce483-e5eb-45c4-86d8-af9312f10fe7n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/CAAKfPhrhYOyiJW7CVZYLc%3DAc1Lr_R_S8TARf86jOEkc-Huq1HQ%40mail.gmail.com.