title: translate curl PUT into ansible uri module
body: <p>I'm trying to deploy a war file to a tomcat manager remotely with a PUT REST call.  I've been able to achieve this with curl but I would like to follow ansible best practices and use the uri module inside my playbook.</p>
  
  <p>Here's the curl command that works. I'm running this from my workstation:</p>
  
  <pre><code>curl -k -X PUT -u $TOMCAT_USER:$TOMCAT_PW --upload-file someapp.war "https://$SERVER:8443/manager/text/deploy?path=/someapp&amp;update=true"
  </code></pre>
  
  <p>And here's my attempt at a task to achieve the same thing (also running this on my workstation):</p>
  
  <pre><code>- name: Push war to Tomcat manager
    uri:
      url: "https://{{ inventory_hostname }}:8443/manager/text/deploy?path=/someapp&amp;update=true"
      src: /opt/someapp.war
      user: "{{ tomcat_manager_username }}"
      password: "{{ tomcat_manager_password }}"
      force_basic_auth: yes
      method: PUT
    delegate_to: 127.0.0.1
  </code></pre>
  
  <p>The ansible task passes with an OK status but it's pushing an empty file instead of the war.  I thought you could use the src parameter to replace the --upload-file flag in curl (since the uri module uses all the parameters from the file module) but apparently that's not the case.  </p>
  
  <p>Can someone point out what I'm doing wrong here?</p>
  
  <p>ansible version: 1.8.4</p>
  
  <p><a href="http://docs.ansible.com/uri_module.html" rel="nofollow">http://docs.ansible.com/uri_module.html</a></p>
  
  <p><a href="http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Deploy_A_New_Application_Archive_(WAR)_Remotely" rel="nofollow">http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Deploy_A_New_Application_Archive_(WAR)_Remotely</a></p>