# Connecting to localhost and 127.0.0.1

**URL:** <https://forum.ansible.com/t/connecting-to-localhost-and-127-0-0-1/21762>\
**Category:** Ansible Project\
**Created:** [June 13, 2016, 9:01pm UTC](https://forum.ansible.com/t/connecting-to-localhost-and-127-0-0-1/21762 "2016-06-13T21:01:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dana\_Christo](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Dana\_Christo](https://forum.ansible.com/u/Dana_Christo)\
**Post date:** [June 13, 2016, 9:01pm UTC](https://forum.ansible.com/t/connecting-to-localhost-and-127-0-0-1/21762/1 "2016-06-13T21:01:19Z")

</div>

When trying to run a playbook without specifying _-i “localhost,” -c local_ I get that the host is unreachable, even though I specify the localhost in my /etc/ansible/hosts file:

[![](https://lh3.googleusercontent.com/-0NJ2lN2qodY/V18eakQxAcI/AAAAAAAAALs/e15XQKxUd5smynscy55Fzj13DXJ9VPVuQCLcB/s400/Screen%2BShot%2B2016-06-13%2Bat%2B1.26.16%2BPM.png)](https://lh3.googleusercontent.com/-0NJ2lN2qodY/V18eakQxAcI/AAAAAAAAALs/e15XQKxUd5smynscy55Fzj13DXJ9VPVuQCLcB/s1600/Screen%2BShot%2B2016-06-13%2Bat%2B1.26.16%2BPM.png)

Is there something I’m missing in the hosts file? Here is the output from running just _ansible-playbook helloworld.yml_:

[![](https://lh3.googleusercontent.com/-xkalRAzvrrA/V18exL7vkMI/AAAAAAAAAL8/Uu9owdBcHkM0i_ukbpFdEnRr-Az9SlH5wCLcB/s400/Screen%2BShot%2B2016-06-13%2Bat%2B1.27.59%2BPM.png)](https://lh3.googleusercontent.com/-xkalRAzvrrA/V18exL7vkMI/AAAAAAAAAL8/Uu9owdBcHkM0i_ukbpFdEnRr-Az9SlH5wCLcB/s1600/Screen%2BShot%2B2016-06-13%2Bat%2B1.27.59%2BPM.png)

---

<div class="post-metadata">

**Author:** ![Peter\_Mooshammer](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@Peter\_Mooshammer](https://forum.ansible.com/u/Peter_Mooshammer)\
**Post date:** [June 14, 2016, 5:33am UTC](https://forum.ansible.com/t/connecting-to-localhost-and-127-0-0-1/21762/2 "2016-06-14T05:33:35Z")

</div>

Can you ssh to localhost without a password?  
Try: ssh localhost

If that works add -vvvv to the ansible command.  
Also why do you want to use ssh to run stuff on your system?
