title: Ansible Playbook creating BitBucket Repository
body: <p>I am trying to create a BitBucket Repository via Ansible Playbook.
  However, running the following command using RestAPI works fine:</p>
  
  <pre><code>curl -u user:Password \
       -d '@data.json' \
       -X POST \
       -H "Content-Type: application/json" \
       http:// https://api.bitbucket.org/1.0/projects/SUN/repos
  </code></pre>
  
  <p>JSON includes the following:</p>
  
  <pre><code>{"name": "my-repo",
   "scmId": "git",
   "forkable": true}
  </code></pre>
  
  <p>I tried all kind of ways to convert this curl command to an ansible playbook but it`s always failing with different errors.</p>
  
  <pre><code>- hosts: localhost
    tasks:
      - name: Create a Bitbucket Repo
        uri:
          url: https://api.bitbucket.org/1.0/projects/SUN/repos
          method: POST
          user: user
          password: password
          src: data.json
          force_basic_auth: yes
          status_code: 201
          body_format: json
  </code></pre>
  
  <p>When leaving "tasks" it says playbook needs to be a list of plays.
  When removing tasks it says "uri" is not valid attribute.</p>
  
  <p>Can anyone advise on the structure the playbook should have in this example?</p>
  
  <p>Thanks a lot</p>