title: Running ansible-playbook using Python API
body: <p>How can I run a playbook in python script? What is the equivalent of the following using ansible module in python:</p>
  
  <pre><code>ansible -i hosts dbservers -m setup
  ansible-playbook -i hosts -vvvv -k site.yml
  </code></pre>
  
  <p>I was looking at their documenation in <a href="http://docs.ansible.com/developing_api.html" rel="noreferrer">http://docs.ansible.com/developing_api.html</a> but they have very limited examples.</p>