title: What's the difference between inventory_hostname and ansible_hostname
body: <p>All I could find was this from <a href="http://docs.ansible.com/ansible/latest/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts" rel="noreferrer">the docs</a>:</p>
  
  <blockquote>
    <p>Additionally, <code>inventory_hostname</code> is the name of the hostname as configured in Ansible’s inventory host file. This can be useful for when you don’t want to rely on the discovered hostname <code>ansible_hostname</code> or for other mysterious reasons. If you have a long FQDN, <code>inventory_hostname_short</code> also contains the part up to the first period, without the rest of the domain.</p>
  </blockquote>
  
  <p>Is there any actual difference between <code>inventory_hostname</code> and <code>ansible_hostname</code> variables in Ansible? If so, then which one should I use and when?</p>