title: Why ansible is not able to ping for locally?
body: <p>Without writing ansible-playbook Why ansible is not able to ping locally ?</p>
  <p>Problem:-</p>
  <p>I have taken 1 ec2 instance and the IP of ec2 is &quot;52.15.160.250&quot;. I installed ansible in it. Inside the inventory file [/etc/ansible/hosts] i have taken</p>
  <blockquote>
  <p>[localhost]</p>
  <p>52.15.160.250</p>
  </blockquote>
  <p>Then <a href="https://i.stack.imgur.com/3wxG0.jpg" rel="nofollow noreferrer">visudo description</a></p>
  <p>I tried to ping local host</p>
  <blockquote>
  <p>ansible -m ping all</p>
  </blockquote>
  <p>or</p>
  <blockquote>
  <p>ansible -m ping 52.15.160.250</p>
  </blockquote>
  <p>I am getting the following error</p>
  <p><a href="https://i.stack.imgur.com/XmE3D.jpg" rel="nofollow noreferrer">error</a></p>