# Passing variables into files for syncing

**URL:** <https://forum.ansible.com/t/passing-variables-into-files-for-syncing/20038>\
**Category:** Ansible Project\
**Created:** [December 17, 2015, 8:39am UTC](https://forum.ansible.com/t/passing-variables-into-files-for-syncing/20038 "2015-12-17T08:39:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forum.ansible.com/u/Colin_Byrne)\
**Post date:** [December 17, 2015, 8:39am UTC](https://forum.ansible.com/t/passing-variables-into-files-for-syncing/20038/1 "2015-12-17T08:39:51Z")

</div>

Hey, so I have a number of essentially identical development servers which have a set of mostly-identical config files. In the config files are small configuration differences for each server, usually a differing API key or a differing host name, which will need to persist for the life of the file. I would love to use ansible to sync the identical portions of the config files, but am looking for a way to also keep the differing portions separate. Is there a way to pass in the server-specific vars as I sync the config files? Any other ideas? Sincere thanks for any help!

---

<div class="post-metadata">

**Author:** ![David\_Karban](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@David\_Karban](https://forum.ansible.com/u/David_Karban)\
**Post date:** [December 17, 2015, 10:30am UTC](https://forum.ansible.com/t/passing-variables-into-files-for-syncing/20038/2 "2015-12-17T10:30:42Z")

</div>

Hi Colin,

look at group\_vars and host\_vars directories: [http://docs.ansible.com/ansible/intro\_inventory.html](http://docs.ansible.com/ansible/intro_inventory.html)

Most of the settings will be in group\_vars and whenever you will need different api key, or anything, you can add it to host\_vars/ directory for that one host.

Regards
