# how to implement a multi-tenant configuration solution in ansible

**URL:** <https://forum.ansible.com/t/how-to-implement-a-multi-tenant-configuration-solution-in-ansible/19588>\
**Category:** Ansible Developer\
**Created:** [October 22, 2015, 11:53am UTC](https://forum.ansible.com/t/how-to-implement-a-multi-tenant-configuration-solution-in-ansible/19588 "2015-10-22T11:53:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Martinez1](https://avatars.discourse-cdn.com/v4/letter/f/ad7895/32.png) [@Francisco\_Martinez1](https://forum.ansible.com/u/Francisco_Martinez1)\
**Post date:** [October 22, 2015, 11:53am UTC](https://forum.ansible.com/t/how-to-implement-a-multi-tenant-configuration-solution-in-ansible/19588/1 "2015-10-22T11:53:24Z")

</div>

Hello!

One common pattern I’ve seen in many applications is [multitenancy](https://en.wikipedia.org/wiki/Multitenancy). Basically, I’m configuring an application that has some of its configuration values which are different based on the country. The way I’ve managed to do this configuration is basically using a “partners” dictionary in yaml:

---

<div class="post-metadata">

**Author:** ![Anatoly\_Zozlinsky](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Anatoly\_Zozlinsky](https://forum.ansible.com/u/Anatoly_Zozlinsky)\
**Post date:** [November 22, 2015, 4:13pm UTC](https://forum.ansible.com/t/how-to-implement-a-multi-tenant-configuration-solution-in-ansible/19588/2 "2015-11-22T16:13:56Z")

</div>

Hi,  
I have related issue and i implemented this as lookup plugin that return a value, based on another vars (like find image\_id based on aws region) and this is working,

but my vars contain {{var}} , and not interpolated

like:  
root\_vars:  
us-east-1:  
sec\_groups: {{app}}-public

and then i ask for “sec\_groups” i got “{{app}}-public” and not “my-app-piblic”

i use ansible 1.9.2

Thanks for help.

---

<div class="post-metadata">

**Author:** ![Anatoly\_Zozlinsky](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Anatoly\_Zozlinsky](https://forum.ansible.com/u/Anatoly_Zozlinsky)\
**Post date:** [November 22, 2015, 4:17pm UTC](https://forum.ansible.com/t/how-to-implement-a-multi-tenant-configuration-solution-in-ansible/19588/3 "2015-11-22T16:17:53Z")

</div>

ahh usage of plugin is:

image: “{{ lookup(‘instance\_var\_provider’, ‘image\_id’) }}”
