# Ansible 2.9 hostvars localhost issue

**URL:** <https://forum.ansible.com/t/ansible-2-9-hostvars-localhost-issue/32076>\
**Category:** Ansible Project\
**Created:** [January 28, 2020, 5:42pm UTC](https://forum.ansible.com/t/ansible-2-9-hostvars-localhost-issue/32076 "2020-01-28T17:42:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Garris](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Michael\_Garris](https://forum.ansible.com/u/Michael_Garris)\
**Post date:** [January 28, 2020, 5:42pm UTC](https://forum.ansible.com/t/ansible-2-9-hostvars-localhost-issue/32076/1 "2020-01-28T17:42:59Z")

</div>

I have a local playbook on my laptop which I use to build local vms for testing. I have noticed recently (with the update to Ansible 2.9) that I have been having issues with the playbook running successfully. It used to work perfectly fine.

ansible version = ansible-2.9.4-1.el8ae.noarch

$ cat vars.yml

---

<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:** [January 28, 2020, 7:03pm UTC](https://forum.ansible.com/t/ansible-2-9-hostvars-localhost-issue/32076/2 "2020-01-28T19:03:11Z")

</div>

In you subject you are hinting of problem with hostvars but that is working fine.  
As you can see it is trying to run against 192.168.122.206 but you get "no hosts matched".

Your new host, 192.168.122.206, is not in your Ansible inventory so it can't find it.  
How is this new host supposed to appear/be added to the the inventory?

---

<div class="post-metadata">

**Author:** ![Michael\_Garris](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Michael\_Garris](https://forum.ansible.com/u/Michael_Garris)\
**Post date:** [January 28, 2020, 8:14pm UTC](https://forum.ansible.com/t/ansible-2-9-hostvars-localhost-issue/32076/3 "2020-01-28T20:14:14Z")

</div>

And that is why I opened this!!! I recently did an upgrade (RHEL7 → RHEL8) so it wiped my /etc/ansible/hosts file. Totally forgot I had added 192.168.122.[1:255] to it!

Thanks Kai!
