Ansible - How attribute 2 value in one variable

Hello guy !! :slight_smile:

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 !!! :slight_smile:

Regards,

Karther

This is covered in Ansible documentation and called host_vars
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html