title: I have a ansible file . I just want to run ansible file in flask API
body: <p>I have one ansible file :</p>
  
  <pre><code> hosts: all
   user: vagrant
   sudo: true
   tasks:
   - user: name=pape shell=/bin/bash groups=admin append=yes
     sudo: true
  
   - name: Creates directory
     file: path=/home/pape/.ssh state=directory owner=pape  group=pape  
           mode=0700
     sudo: true
  
   - name: Make sure that the /home/{{createuser}} directory exsists
     action: file path=/home/james/.ssh state=directory
  
   - name: Setup | authorized key upload
     copy: src=/home/birendra/.ssh/id_rsa.pub 
      dest=/home/pape/.ssh/authorized_keys owner=pape group=pape  
      mode=0600
  </code></pre>
  
  <p>This ansible-playbook is running successfully in vagrant<br>
     (config.vm.network "private_network", ip: "192.168.33.10").</p>
  
  <p>I want to run this file in flask API . I also have one inventory file 
     (127.0.0.1 and 192.168.33.10)</p>
  
  <p>I wrote playbook ansible API </p>
  
  <pre><code> playbook = PlayBook(remote_user='vagrant',      
   playbook='/home/birendra/vagrant/playbook.yml',callbacks=playbook_cb, 
   runner_callbacks=runner_cb, stats=stats, host_list=  
   '/home/birendra/birendra/inventory/swat-
   staging.ini' )
  </code></pre>
  
  <p>But it is not working</p>