# Ansible - How attribute 2 value in one variable

**URL:** <https://forum.ansible.com/t/ansible-how-attribute-2-value-in-one-variable/31698>\
**Category:** Ansible Project\
**Created:** [November 21, 2019, 10:29am UTC](https://forum.ansible.com/t/ansible-how-attribute-2-value-in-one-variable/31698 "2019-11-21T10:29:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karther](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@Karther](https://forum.ansible.com/u/Karther)\
**Post date:** [November 21, 2019, 10:29am UTC](https://forum.ansible.com/t/ansible-how-attribute-2-value-in-one-variable/31698/1 "2019-11-21T10:29:24Z")

</div>

Hello guy !! 🙂

I have any problem, can you help me please ?

I have 2 remote hosts, and i must deploy one template file.

The problem is i want one variable for one host and not for the both, exemple :

The content of my file template :

{{ my\_ip\_addr\_host }}

somevalue=toto  
somevalue1=toto2  
…

I want when i deploy this template,on my host 1 {{ my\_ip\_addr\_host }} get value 10.10.10.1 and when i deploy this template on my host 2 {{ my\_ip\_addr\_host }} get value 10.10.10.2

I deploy on the same groupe [my\_groupe] so the same environnement.

How resolve this problem please community ansible ???

Thank you very much !!! 🙂

Regards,

Karther

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 21, 2019, 11:02am UTC](https://forum.ansible.com/t/ansible-how-attribute-2-value-in-one-variable/31698/2 "2019-11-21T11:02:26Z")

</div>

This is covered in Ansible documentation and called host\_vars  
[https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)
