{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/12856","labels_url":"https://api.github.com/repos/ansible/ansible/issues/12856/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/12856/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/12856/events","html_url":"https://github.com/ansible/ansible/issues/12856","id":112654789,"number":12856,"title":"Ansible 2.0 breaks \"here\" documents in shell scripts","user":{"login":"larsks","id":82622,"avatar_url":"https://avatars.githubusercontent.com/u/82622?v=3","gravatar_id":"","url":"https://api.github.com/users/larsks","html_url":"https://github.com/larsks","followers_url":"https://api.github.com/users/larsks/followers","following_url":"https://api.github.com/users/larsks/following{/other_user}","gists_url":"https://api.github.com/users/larsks/gists{/gist_id}","starred_url":"https://api.github.com/users/larsks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsks/subscriptions","organizations_url":"https://api.github.com/users/larsks/orgs","repos_url":"https://api.github.com/users/larsks/repos","events_url":"https://api.github.com/users/larsks/events{/privacy}","received_events_url":"https://api.github.com/users/larsks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-21T18:49:57Z","updated_at":"2015-10-21T18:49:57Z","closed_at":null,"body":"I wanted to embed a \"here\" document (e.g. `cat <<EOF ...`) in a `shell:` script in my playbook, like this:\r\n\r\n    shell: |\r\n      . credentials/keystonerc_admin\r\n\r\n      cat <<-EOF\r\n      auth_url: \"$OS_AUTH_URL\"\r\n      username: \"$OS_USERNAME\"\r\n      password: \"$OS_PASSWORD\"\r\n      tenant_name: \"$OS_TENANT_NAME\"\r\n      EOF\r\n\r\nIn 1.9.4, this breaks because the magic processing that looks for\r\nmodule arguments in the command string resulted in the following\r\nscript:\r\n\r\n    . credentials/keystonerc_admin\r\n\r\n     cat <<-EOF\r\n     auth_url: \\\"$OS_AUTH_URL\\\"\r\n     username: \\\"$OS_USERNAME\\\"\r\n     password: \\\"$OS_PASSWORD\\\"\r\n     tenant_name: \\\"$OS_TENANT_NAME\\\"\r\n     EOF\r\n\r\nNote the extra space (` `) at the beginning of every line, which\r\nbreaks shell parsing.  It was possible to fix this by passing the\r\nscript directly to the `cmd` parameter, which would bypass the magic\r\n\"look for arguments\" processing:\r\n\r\n    shell:\r\n      cmd: |\r\n        . credentials/keystonerc_admin\r\n\r\n        cat <<-EOF\r\n        auth_url: \"$OS_AUTH_URL\"\r\n        username: \"$OS_USERNAME\"\r\n        password: \"$OS_PASSWORD\"\r\n        tenant_name: \"$OS_TENANT_NAME\"\r\n        EOF\r\n\r\nThis worked great.  But then Ansible 2.0 came along, and the above\r\nfails with:\r\n\r\n    unsupported parameter for module: cmd\r\n\r\nAnd without the `cmd:` parameter, it fails the same was as in 1.9.4.\r\n\r\n\r\n"}}