{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/12241","labels_url":"https://api.github.com/repos/ansible/ansible/issues/12241/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/12241/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/12241/events","html_url":"https://github.com/ansible/ansible/issues/12241","id":104801633,"number":12241,"title":"Newlines in YAML vars are being ignored when using Jinja filters in templates","user":{"login":"jesseiqmi","id":5066948,"avatar_url":"https://avatars.githubusercontent.com/u/5066948?v=3","gravatar_id":"","url":"https://api.github.com/users/jesseiqmi","html_url":"https://github.com/jesseiqmi","followers_url":"https://api.github.com/users/jesseiqmi/followers","following_url":"https://api.github.com/users/jesseiqmi/following{/other_user}","gists_url":"https://api.github.com/users/jesseiqmi/gists{/gist_id}","starred_url":"https://api.github.com/users/jesseiqmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesseiqmi/subscriptions","organizations_url":"https://api.github.com/users/jesseiqmi/orgs","repos_url":"https://api.github.com/users/jesseiqmi/repos","events_url":"https://api.github.com/users/jesseiqmi/events{/privacy}","received_events_url":"https://api.github.com/users/jesseiqmi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-03T23:34:23Z","updated_at":"2015-09-03T23:34:23Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n  - Bug Report\r\n\r\n##### Ansible Version:\r\n\r\nansible-playbook 2.0.0 (devel 7ece767767) last updated 2015/09/03 10:59:37 (GMT -700)\r\n  lib/ansible/modules/core: (detached HEAD bbcfb1092a) last updated 2015/09/02 17:49:00 (GMT -700)\r\n  lib/ansible/modules/extras: (detached HEAD b8803306d1) last updated 2015/09/02 17:49:00 (GMT -700)\r\n  config file = \r\n  configured module search path = None\r\n\r\n##### Ansible Configuration:\r\n\r\nN/A\r\n\r\n##### Environment:\r\n\r\nOSX Yosemite 10.10.5 to Ubuntu 14.04\r\n\r\n##### Summary:\r\n\r\nNewlines within YAML var files don't seem to be observed as they should within a template with usage such as `environment={{ app_environment | mandatory | replace('\\n', ',') }}`  \r\n  \r\nThe behavior seemed to have changed (i.e. it was working as described) within the last couple of days (4 or so) since I had last pulled to refresh Ansible locally dev.  \r\n  \r\nThe current work around that I have in place is just to flatten the environment variables myself ahead of time, but it makes it more difficult to manage as you start to load in extra env vars.\r\n\r\n##### Steps To Reproduce:\r\n\r\nFollowed the steps provided in http://blog.paulopoiati.com/2015/03/01/how-do-i-configure-environment-variables-in-ansible/ for supervisor configuration with ngnix+unicorn+rails.\r\n\r\nRelevant variables\r\n```yaml\r\napp_environment: |\r\n    RAILS_ENV={{ env }}\r\n    SECRET_KEY_BASE={{ secret_key_base }}\r\n    WEB_CONCURRENCY={{ web_concurrency }}\r\n```\r\n\r\nTemplate\r\n```ini\r\n[program:unicorn]\r\nuser={{ deploy_user_username }}\r\ndirectory=/home/{{ deploy_user_username }}/apps/{{ app_name }}\r\ncommand=bundle exec unicorn -c config/unicorn.rb\r\nautostart=true\r\nautorestart=true\r\nenvironment={{ app_environment | mandatory | replace('\\n', ',') }}\r\n```\r\n\r\n##### Expected Results:\r\n\r\n```ini\r\n[program:unicorn]\r\nuser=deploy\r\ndirectory=/home/deploy/apps/opsapp\r\ncommand=bundle exec unicorn -c config/unicorn.rb\r\nautostart=true\r\nautorestart=true\r\nenvironment=RAILS_ENV=staging,SECRET_KEY_BASE=secret,WEB_CONCURRENCY=2\r\n```\r\n\r\n##### Actual Results:\r\n\r\n```ini\r\n[program:unicorn]\r\nuser=deploy\r\ndirectory=/home/deploy/apps/opsapp\r\ncommand=bundle exec unicorn -c config/unicorn.rb\r\nautostart=true\r\nautorestart=true\r\nenvironment=RAILS_ENV=staging\r\nSECRET_KEY_BASE=secret\r\nWEB_CONCURRENCY=2\r\n```"}}