Created
November 3, 2014 21:43
-
-
Save lancehudson/3e7e15b2a11f6cc4b4eb to your computer and use it in GitHub Desktop.
ansible-modules-core Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-bash-4.2$ ansible-playbook -vvvv -i hosts job/facebook.yml --connection=local | |
PLAY [Run Facebook job] ******************************************************* | |
TASK: [debug var=body] ******************************************************** | |
ok: [127.0.0.1] => (item=1) => { | |
"body": { | |
"data": { | |
"args": { | |
"accountId": "1", | |
"facebookDatePreset": "last_90_days" | |
}, | |
"title": "load" | |
}, | |
"type": "facebook" | |
}, | |
"item": 1 | |
} | |
ok: [127.0.0.1] => (item=2) => { | |
"body": { | |
"data": { | |
"args": { | |
"accountId": "2", | |
"facebookDatePreset": "last_90_days" | |
}, | |
"title": "load" | |
}, | |
"type": "facebook" | |
}, | |
"item": 2 | |
} | |
TASK: [debug msg="{"data": {"args": {"facebookDatePreset": "last_90_days", "accountId": "{{item}}"}, "title": "load"}, "type": "facebook"}"] *** | |
ok: [127.0.0.1] => (item=1) => { | |
"item": 1, | |
"msg": "{\"type\": \"facebook\", \"data\": {\"args\": {\"accountId\": \"1\", \"facebookDatePreset\": \"last_90_days\"}, \"title\": \"load\"}}" | |
} | |
ok: [127.0.0.1] => (item=2) => { | |
"item": 2, | |
"msg": "{\"type\": \"facebook\", \"data\": {\"args\": {\"accountId\": \"2\", \"facebookDatePreset\": \"last_90_days\"}, \"title\": \"load\"}}" | |
} | |
TASK: [Call job for each account] ******************************************** | |
<127.0.0.1> REMOTE_MODULE uri method=POST HEADER_Content-Type=application/json url=http://localhost:3000 | |
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862 && echo $HOME/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862'] | |
<127.0.0.1> PUT /tmp/tmpAAXWec TO /var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/uri | |
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=C LC_CTYPE=C /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/uri; rm -rf /var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/ >/dev/null 2>&1'] | |
failed: [127.0.0.1] => (item=1) => {"failed": true, "item": 1, "parsed": false} | |
invalid output was: Traceback (most recent call last): | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/uri", line 1791, in <module> | |
main() | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/uri", line 403, in main | |
resp, content, dest = uri(module, url, dest, user, password, body, method, dict_headers, redirects, socket_timeout) | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045002.95-30498840200862/uri", line 302, in uri | |
resp, content = h.request(url, method=method, body=body, headers=headers) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1605, in request | |
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1353, in _request | |
(response, content) = self._conn_request(conn, request_uri, method, body, headers) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1290, in _conn_request | |
conn.request(method, request_uri, body, headers) | |
File "/usr/lib64/python2.7/httplib.py", line 973, in request | |
self._send_request(method, url, body, headers) | |
File "/usr/lib64/python2.7/httplib.py", line 1007, in _send_request | |
self.endheaders(body) | |
File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders | |
self._send_output(message_body) | |
File "/usr/lib64/python2.7/httplib.py", line 833, in _send_output | |
self.send(message_body) | |
File "/usr/lib64/python2.7/httplib.py", line 805, in send | |
self.sock.sendall(data) | |
File "/usr/lib64/python2.7/socket.py", line 224, in meth | |
return getattr(self._sock,name)(*args) | |
TypeError: must be string or buffer, not dict | |
<127.0.0.1> REMOTE_MODULE uri method=POST HEADER_Content-Type=application/json url=http://localhost:3000 | |
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607 && echo $HOME/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607'] | |
<127.0.0.1> PUT /tmp/tmpJlkZy0 TO /var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/uri | |
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=C LC_CTYPE=C /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/uri; rm -rf /var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/ >/dev/null 2>&1'] | |
failed: [127.0.0.1] => (item=2) => {"failed": true, "item": 2, "parsed": false} | |
invalid output was: Traceback (most recent call last): | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/uri", line 1791, in <module> | |
main() | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/uri", line 403, in main | |
resp, content, dest = uri(module, url, dest, user, password, body, method, dict_headers, redirects, socket_timeout) | |
File "/var/lib/awx/.ansible/tmp/ansible-tmp-1415045003.04-25850512266607/uri", line 302, in uri | |
resp, content = h.request(url, method=method, body=body, headers=headers) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1605, in request | |
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1353, in _request | |
(response, content) = self._conn_request(conn, request_uri, method, body, headers) | |
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1290, in _conn_request | |
conn.request(method, request_uri, body, headers) | |
File "/usr/lib64/python2.7/httplib.py", line 973, in request | |
self._send_request(method, url, body, headers) | |
File "/usr/lib64/python2.7/httplib.py", line 1007, in _send_request | |
self.endheaders(body) | |
File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders | |
self._send_output(message_body) | |
File "/usr/lib64/python2.7/httplib.py", line 833, in _send_output | |
self.send(message_body) | |
File "/usr/lib64/python2.7/httplib.py", line 805, in send | |
self.sock.sendall(data) | |
File "/usr/lib64/python2.7/socket.py", line 224, in meth | |
return getattr(self._sock,name)(*args) | |
TypeError: must be string or buffer, not dict | |
FATAL: all hosts have already failed -- aborting | |
PLAY RECAP ******************************************************************** | |
to retry, use: --limit @/var/lib/awx/facebook.retry | |
127.0.0.1 : ok=2 changed=0 unreachable=0 failed=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Run Facebook job | |
hosts: all | |
gather_facts: no | |
vars: | |
url: http://localhost:3001/job | |
accounts: | |
- 1 | |
- 2 | |
body: | |
type: facebook | |
data: | |
title: "load" | |
args: | |
accountId: "{{item}}" | |
facebookDatePreset: last_90_days | |
tasks: | |
- debug: var=body | |
with_items: accounts | |
- debug: msg="{{body | to_json}}" | |
with_items: accounts | |
- name: Call job for each account | |
uri: | |
method: POST | |
HEADER_Content-Type: "application/json" | |
url: "{{url}}" | |
return_content: no | |
body: "{{ body | to_json }}" | |
with_items: accounts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Run Facebook job | |
hosts: all | |
gather_facts: no | |
vars: | |
url: http://localhost:3001/job | |
accounts: | |
- 1 | |
- 2 | |
tasks: | |
- name: Call job for each account | |
uri: | |
method: POST | |
HEADER_Content-Type: "application/json" | |
url: "{{url}}" | |
return_content: yes | |
body: "{\"type\": \"facebook\", \"data\": {\"args\": {\"accountId\": \"{{item}}\", \"facebookDatePreset\": \"last_90_days\"}, \"title\": \"load\"} }" | |
with_items: accounts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Run Facebook job | |
hosts: all | |
gather_facts: no | |
vars: | |
url: http://localhost:3001/job | |
accounts: | |
- 1 | |
- 2 | |
tasks: | |
- name: Call job for each account | |
uri: | |
method: POST | |
HEADER_Content-Type: "application/json" | |
url: "{{url}}" | |
return_content: yes | |
body: "{\"type\": \"facebook\", \"data\": {\"args\": {\"accountId\": \"1\", \"facebookDatePreset\": \"last_90_days\"}, \"title\": \"load\"} }" | |
with_items: accounts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment