title: Retrieving host information inside jinja template
body: <p>My host file for ansible looks as below </p>
  
  <pre><code>[deployment]
  server1 ansible_ssh_host=x.x.x.x ansible_ssh_user=root ansible_ssh_pass=abcdefg ansible_br_mgmt_ip=192.10.2.5 ansible_br_vlan_ip=192.10.4.5 ansible_br_vxlan_ip=192.10.8.5
  server2 ansible_ssh_host=y.y.y.y ansible_ssh_user=root ansible_ssh_pass=abcdefg ansible_br_mgmt_ip=192.10.2.6 ansible_br_vlan_ip=192.10.4.7 ansible_br_vxlan_ip=192.10.8.8
  </code></pre>
  
  <p>Inside jinja template (.j2 file) i am trying to retrieve the value of ansible_br_mgmt of server 1 or server 2 </p>
  
  <p>i tried the following ways , but couldnt get the exact IP address. </p>
  
  <pre><code>hostname: "{%  {{  hostvars['deployment'].ansible_br_mgmt_ip }} %}"
  
  hostvars.deployment.ansible_br_mgmt_ip
  groups['deployment'][ansible_br_mgmt_ip]
  </code></pre>
  
  <p>can you please help on this ?</p>