title: Ansible hosts configuration using private key and sudo user
body: <p>Hi I have written a playbook for Ansible to install a few application. I am having trouble as I have to run every thing as root which is not a good idea.</p>
  
  <p>So I have created a sudo user and have created a private key for authentication.</p>
  
  <p>Could some one help me in defining the hosts file for this scenario.</p>
  
  <p>My current hosts file is like this:</p>
  
  <pre><code>[webserver]
  web-01 ansible_ssh_host=192.168.0.11 ansible_ssh_user=root
  </code></pre>
  
  <p>Thanks,  </p>