Write data with a PUT request with Ansible URI module
Finally I got it working by setting the status code, the header's content type and the return content by adding these lines:
status_code: 200return_content: yesHEADER_Content-Type: "application/x-www-form-urlencoded"
So the final must look like:
- uri: url: "{{ etcd_server }}/v2/keys/coreos.com/network/config" method: PUT body: "value={aa}" status_code: 200 return_content: yes HEADER_Content-Type: "application/x-www-form-urlencoded"