Hi,

Tearing what little hair I have left:

This is the fragment of the playbook:
- name: create new RE if RE doesn't exist
uri:
url: https://api.eu.cloud.talend.com/tmc/v1.3/runtimes/remote-engines
method: POST
headers:
Authorization: Basic {{talend_personal_access_token}}
Accept: application/json
status-code: 201
body-format: json
* body:*
* name: "{{RE_name}}"*
register: new_RE_response
when: check_response.json[0].id is undefined

If I remove the body: part then, well it doesn't work but the failure is a 
response code from the webservice (415), with it in I get: 

{ "status": -1, "exception": "Traceback (most recent call last):\n File 
\"/tmp/ansible_uri_payload_nEptqB/ansible_uri_payload.zip/ansible/module_utils/urls.py\",
 
line 1359, in fetch_url\n unix_socket=unix_socket)\n File 
\"/tmp/ansible_uri_payload_nEptqB/ansible_uri_payload.zip/ansible/module_utils/urls.py\",
 
line 1257, in open_url\n use_gssapi=use_gssapi, unix_socket=unix_socket)\n 
File 
\"/tmp/ansible_uri_payload_nEptqB/ansible_uri_payload.zip/ansible/module_utils/urls.py\",
 
line 1163, in open\n r = urllib_request.urlopen(*urlopen_args)\n File 
\"/usr/lib64/python2.7/urllib2.py\", line 154, in urlopen\n return 
opener.open(url, data, timeout)\n File \"/usr/lib64/python2.7/urllib2.py\", 
line 431, in open\n response = self._open(req, data)\n File 
\"/usr/lib64/python2.7/urllib2.py\", line 449, in _open\n '_open', req)\n 
File \"/usr/lib64/python2.7/urllib2.py\", line 409, in _call_chain\n result 
= func(*args)\n File 
\"/tmp/ansible_uri_payload_nEptqB/ansible_uri_payload.zip/ansible/module_utils/urls.py\",
 
line 356, in https_open\n return self.do_open(CustomHTTPSConnection, req)\n 
File \"/usr/lib64/python2.7/urllib2.py\", line 1211, in do_open\n 
h.request(req.get_method(), req.get_selector(), req.data, headers)\n File 
\"/usr/lib64/python2.7/httplib.py\", line 1056, in request\n 
self._send_request(method, url, body, headers)\n File 
\"/usr/lib64/python2.7/httplib.py\", line 1090, in _send_request\n 
self.endheaders(body)\n File \"/usr/lib64/python2.7/httplib.py\", line 
1052, in endheaders\n self._send_output(message_body)\n File 
\"/usr/lib64/python2.7/httplib.py\", line 894, in _send_output\n 
self.send(message_body)\n File \"/usr/lib64/python2.7/httplib.py\", line 
866, in send\n self.sock.sendall(data)\n File 
\"/usr/lib64/python2.7/ssl.py\", line 744, in sendall\n v = 
self.send(data[count:])\nTypeError: unhashable type\n", "url": 
"https://api.eu.cloud.talend.com/tmc/v1.3/runtimes/remote-engines";, 
"changed": false, "elapsed": 1, "content": "", "invocation": { 
"module_args": { "directory_mode": null, "force": false, "remote_src": 
null, "status_code": [ 200 ], "follow": false, "owner": null, 
"body_format": "raw", "body-format": "json", "client_key": null, "group": 
null, "use_proxy": true, "headers": { "Accept": "application/json", 
"Authorization": "Basic <censored>" }, "unsafe_writes": null, "setype": 
null, "content": null, "serole": null, "follow_redirects": "safe", 
"return_content": false, "client_cert": null, "body": { "name": 
"RHEL_X.X.X.X_AZGLGBNEVTA30_PRODUCTION_C4E" }, "timeout": 30, "src": null, 
"dest": null, "selevel": null, "force_basic_auth": true, "removes": null, 
"http_agent": "ansible-httpget", "regexp": null, "status-code": 201, 
"url_password": null, "url": 
"https://api.eu.cloud.talend.com/tmc/v1.3/runtimes/remote-engines";, 
"validate_certs": true, "seuser": null, "method": "POST", "creates": null, 
"unix_socket": null, "delimiter": null, "mode": null, "url_username": null, 
"attributes": null, "backup": null } }, "redirected": false, * "msg": 
"Status code was -1 and not [200]: An unknown error occurred: unhashable 
type",* "_ansible_no_log": false } 

For reference:
ansible --version ansible 2.9.4 config file = /etc/ansible/ansible.cfg 
configured module search path = 
[u'/home/jason_ho/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules'] ansible python module location = 
/usr/lib/python2.7/site-packages/ansible executable location = 
/usr/bin/ansible python version = 2.7.5 (default, Jun 11 2019, 14:33:56) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] 

This is running through AWX 9.1.1

Am I doing something wrong or have I ran into a bug?

Cheers

Stephen

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3d20e218-c443-4c73-9bf4-505874d2e698%40googlegroups.com.

Reply via email to