# files in group\_vars?

**URL:** <https://forum.ansible.com/t/files-in-group-vars/20489>\
**Category:** Ansible Project\
**Created:** [February 8, 2016, 4:04pm UTC](https://forum.ansible.com/t/files-in-group-vars/20489 "2016-02-08T16:04:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [February 8, 2016, 4:04pm UTC](https://forum.ansible.com/t/files-in-group-vars/20489/1 "2016-02-08T16:04:44Z")

</div>

Problem:  
We want a simple nginx role that can be re-used in different ways, i.e. not serving same purpose, and with entirely unrelated files in /etc/nginx/conf.d/

Can we use files as if they were in roles/nginx/files but instead the files are read from group\_vars in a way that correspond with inventory/env and group\_vars/env? The idea being to decouple the files from the role… Thanks

---

<div class="post-metadata">

**Author:** ![David\_Negreira](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@David\_Negreira](https://forum.ansible.com/u/David_Negreira)\
**Post date:** [February 8, 2016, 5:41pm UTC](https://forum.ansible.com/t/files-in-group-vars/20489/2 "2016-02-08T17:41:23Z")

</div>

You can use the template module to build up your nginx configuration files from variables
