{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/46113","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/46113/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/46113/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/46113/events","html_url":"https://github.com/ansible/ansible/issues/46113","id":363533961,"node_id":"MDU6SXNzdWUzNjM1MzM5NjE=","number":46113,"title":"template module generate corrupted output when using native type","user":{"login":"Jean-Daniel","id":304649,"node_id":"MDQ6VXNlcjMwNDY0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/304649?v=4","gravatar_id":"","url":"https://api.github.com/users/Jean-Daniel","html_url":"https://github.com/Jean-Daniel","followers_url":"https://api.github.com/users/Jean-Daniel/followers","following_url":"https://api.github.com/users/Jean-Daniel/following{/other_user}","gists_url":"https://api.github.com/users/Jean-Daniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Jean-Daniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jean-Daniel/subscriptions","organizations_url":"https://api.github.com/users/Jean-Daniel/orgs","repos_url":"https://api.github.com/users/Jean-Daniel/repos","events_url":"https://api.github.com/users/Jean-Daniel/events{/privacy}","received_events_url":"https://api.github.com/users/Jean-Daniel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-25T11:35:55Z","updated_at":"2018-09-25T11:41:08Z","closed_at":null,"author_association":"NONE","body":"<!--- Verify first that your issue is not already reported on GitHub -->\r\n<!--- Also test if the latest release and devel branch are affected too -->\r\n<!--- Complete *all* sections as described, this form is processed automatically -->\r\n\r\n##### SUMMARY\r\nWhen using `jinja2_native = true`, the template module generate very strange and invalid output.\r\n\r\nFor instance, templating the very simple template:\r\n```\r\nconnection-mesh {\r\n{{ 'bar' }}\r\n}\r\n```\r\n\r\noutputs\r\n\r\n```\r\n\r\nconnection-mesh {\r\nbar\r\nconnection-mesh {\r\nbar\r\n}\r\n```\r\n\r\n##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\ntemplate\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes -->\r\n```\r\nansible 2.7.0rc3.post0\r\n  config file = /Users/jddupas/Projects/python/playbooks/nativetpl/ansible.cfg\r\n  configured module search path = ['/Users/jddupas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /Users/jddupas/Projects/python/playbooks/env/lib/python3.6/site-packages/ansible\r\n  executable location = /Users/jddupas/Projects/python/playbooks/env/bin/ansible\r\n  python version = 3.6.5 (default, Apr 17 2018, 10:37:08) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- Paste verbatim output from \"ansible-config dump --only-changed\" between quotes -->\r\n```paste below\r\nDEFAULT_DEBUG(/Users/jddupas/Projects/python/playbooks/nativetpl/ansible.cfg) = False\r\nDEFAULT_JINJA2_NATIVE(/Users/jddupas/Projects/python/playbooks/nativetpl/ansible.cfg) = True\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\nN/A\r\n\r\nTested on both macOS and Linux\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->\r\n\r\nplaybook.yaml\r\n```yaml\r\n- hosts: localhost\r\n  tasks:\r\n  - debug:\r\n      msg: \"{{ lookup('template', 'active-passive.res.j2') }}\"\r\n\r\n```\r\n\r\ntemplates/active-passive.res.j2\r\n```\r\n\r\nconnection-mesh {\r\n{{ 'bar' }}\r\n}\r\n\r\n```\r\n\r\n\r\n##### EXPECTED RESULTS\r\n```\r\nTASK [debug] *********************************************************\r\nok: [server-1] => {\r\n    \"msg\": \"\\nconnection-mesh {\\nbar\\n}\\n\"\r\n}\r\n\r\n```\r\n\r\n##### ACTUAL RESULTS\r\n```\r\nTASK [debug] *********************************************************\r\nok: [server-1] => {\r\n    \"msg\": \"\\nconnection-mesh {\\nbar\\nconnection-mesh {\\nbar\\n}\"\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/424309505","html_url":"https://github.com/ansible/ansible/issues/46113#issuecomment-424309505","issue_url":"https://api.github.com/repos/ansible/ansible/issues/46113","id":424309505,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDMwOTUwNQ==","user":{"login":"ansibot","id":6585283,"node_id":"MDQ6VXNlcjY1ODUyODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T11:41:08Z","updated_at":"2018-09-25T11:41:08Z","author_association":"CONTRIBUTOR","body":"Files identified in the description:\n* [lib/ansible/modules/files/template.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/template.py)\n\nIf these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.\n\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: components_banner --->"}}
{"actor":{"display_login":"ansibot"}}