{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/265","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/265/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/265/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/265","id":47648944,"number":265,"title":"Error when using URI module to send JSON body with variables - TypeError: must be string or buffer, not dict","user":{"login":"lancehudson","id":1708894,"avatar_url":"https://avatars.githubusercontent.com/u/1708894?v=3","gravatar_id":"","url":"https://api.github.com/users/lancehudson","html_url":"https://github.com/lancehudson","followers_url":"https://api.github.com/users/lancehudson/followers","following_url":"https://api.github.com/users/lancehudson/following{/other_user}","gists_url":"https://api.github.com/users/lancehudson/gists{/gist_id}","starred_url":"https://api.github.com/users/lancehudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lancehudson/subscriptions","organizations_url":"https://api.github.com/users/lancehudson/orgs","repos_url":"https://api.github.com/users/lancehudson/repos","events_url":"https://api.github.com/users/lancehudson/events{/privacy}","received_events_url":"https://api.github.com/users/lancehudson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-11-03T21:47:31Z","updated_at":"2015-03-25T01:03:38Z","closed_at":null,"body":"##### Issue Type:\r\n\r\nBug Report\r\n\r\n##### Ansible Version:\r\n\r\nansible 1.7.2\r\n\r\n##### Environment:\r\n\r\ncentos 7\r\npython 2.7.5\r\n\r\n##### Summary:\r\n\r\nI am getting a TypeError when attempting to send a JSON body in a URI POST that is using a variable.\r\n\r\n##### Steps To Reproduce:\r\n\r\nrun this playbook - https://gist.github.com/lancehudson/3e7e15b2a11f6cc4b4eb#file-playbook-fails\r\n\r\n    bash-4.2$ ansible-playbook -vvvv -i hosts playbook-fails.yml --connection=local\r\n\r\n##### Expected Results:\r\n\r\nno error, post being sent.\r\n\r\n##### Actual Results:\r\n\r\nError: TypeError: must be string or buffer, not dict\r\n\r\nhttps://gist.github.com/lancehudson/3e7e15b2a11f6cc4b4eb#file-error\r\n\r\n##### Other:\r\n\r\nIf I hardcode the response it works: https://gist.github.com/lancehudson/3e7e15b2a11f6cc4b4eb#file-playbook-hardcoded\r\n\r\nAs soon as I introduce an error it fails with the same error: https://gist.github.com/lancehudson/3e7e15b2a11f6cc4b4eb#file-playbook-fails-2\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/85768265","html_url":"https://github.com/ansible/ansible-modules-core/issues/265#issuecomment-85768265","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/265","id":85768265,"user":{"login":"airandfingers","id":1088051,"avatar_url":"https://avatars.githubusercontent.com/u/1088051?v=3","gravatar_id":"","url":"https://api.github.com/users/airandfingers","html_url":"https://github.com/airandfingers","followers_url":"https://api.github.com/users/airandfingers/followers","following_url":"https://api.github.com/users/airandfingers/following{/other_user}","gists_url":"https://api.github.com/users/airandfingers/gists{/gist_id}","starred_url":"https://api.github.com/users/airandfingers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airandfingers/subscriptions","organizations_url":"https://api.github.com/users/airandfingers/orgs","repos_url":"https://api.github.com/users/airandfingers/repos","events_url":"https://api.github.com/users/airandfingers/events{/privacy}","received_events_url":"https://api.github.com/users/airandfingers/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T01:03:38Z","updated_at":"2015-03-25T01:03:38Z","body":"+1"}}