# Using the same role for configs that go beyond templating

**URL:** <https://forum.ansible.com/t/using-the-same-role-for-configs-that-go-beyond-templating/18431>\
**Category:** Ansible Project\
**Created:** [June 8, 2015, 3:25pm UTC](https://forum.ansible.com/t/using-the-same-role-for-configs-that-go-beyond-templating/18431 "2015-06-08T15:25:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roger\_Sherman1](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Roger\_Sherman1](https://forum.ansible.com/u/Roger_Sherman1)\
**Post date:** [June 8, 2015, 3:25pm UTC](https://forum.ansible.com/t/using-the-same-role-for-configs-that-go-beyond-templating/18431/1 "2015-06-08T15:25:51Z")

</div>

Can anyone tell me if there’s a way to use the same role, to pass completely different config files to an app?

My issue is I need to set up nginx as a load balancer on one node, but as web servers on another node. I can’t just template the changes, I need to push a different set of files to each - there are some files that will exist on the load balancer that I don’t want to exist on the web servers, and vice versa. I haven’t found anything in the documentation that deals directly with that type of issue. Creating multiple nginx roles seems inelegant - is there a way to do this with just the one role?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 3:32pm UTC](https://forum.ansible.com/t/using-the-same-role-for-configs-that-go-beyond-templating/18431/2 "2015-06-08T15:32:57Z")

</div>

you can pass a role a list as a variable, iterate over that to  
template/copy the files as needed, use defaults for the  
baseline/common case.

---

<div class="post-metadata">

**Author:** ![Roger\_Sherman1](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Roger\_Sherman1](https://forum.ansible.com/u/Roger_Sherman1)\
**Post date:** [June 8, 2015, 3:45pm UTC](https://forum.ansible.com/t/using-the-same-role-for-configs-that-go-beyond-templating/18431/3 "2015-06-08T15:45:54Z")

</div>

Ok, great, that sounds perfect. Thanks Brian!
