{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/13846","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/13846/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/13846/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/13846/events","html_url":"https://github.com/ansible/ansible/issues/13846","id":126445090,"number":13846,"title":"[2.0] Specifying a role whose name is a variable value doesn't work as expected","user":{"login":"yansal","id":1910607,"avatar_url":"https://avatars0.githubusercontent.com/u/1910607?v=4","gravatar_id":"","url":"https://api.github.com/users/yansal","html_url":"https://github.com/yansal","followers_url":"https://api.github.com/users/yansal/followers","following_url":"https://api.github.com/users/yansal/following{/other_user}","gists_url":"https://api.github.com/users/yansal/gists{/gist_id}","starred_url":"https://api.github.com/users/yansal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yansal/subscriptions","organizations_url":"https://api.github.com/users/yansal/orgs","repos_url":"https://api.github.com/users/yansal/repos","events_url":"https://api.github.com/users/yansal/events{/privacy}","received_events_url":"https://api.github.com/users/yansal/received_events","type":"User","site_admin":false},"labels":[{"id":437720458,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.0","name":"affects_2.0","color":"5319e7","default":false},{"id":437720635,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.1","name":"affects_2.1","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":54811101,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420","default":false},{"id":572345061,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_template","name":"needs_template","color":"f9d0c4","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-01-13T15:36:09Z","updated_at":"2017-11-22T00:36:20Z","closed_at":"2017-11-22T00:36:20Z","author_association":"NONE","body":"##### Issue Type:\n- Bug Report\n##### Ansible Version:\n\n```\nansible 2.1.2.0\n  config file = \n  configured module search path = Default w/o overrides\n```\n##### Ansible Configuration:\n\nNone\n##### Environment:\n\nOS X 10.11.6\n##### Summary:\n\nI want to include a playbook twice with different parameters, and inside this playbook I want to specify a role whose name _actually is_ the parameter value.\n\nIt works with ansible 1.9.6 and is broken since ansible 2.0.0\n##### Steps To Reproduce:\n\n```\n$ cat playbook.yml\n- include: include.yml env=first\n- include: include.yml env=second\n$ cat include.yml \n- hosts: localhost\n  roles:\n    - \"{{ env }}\"\n$ cat roles/first/tasks/main.yml \n- debug: msg=\"Hello from first\"\n$ cat roles/second/tasks/main.yml \n- debug: msg=\"Hello from second\"\n$ ansible-playbook playbook.yml\n```\n##### Expected Results:\n\n```\nPLAY [localhost] ************************************************************** \n\nGATHERING FACTS *************************************************************** \nok: [localhost]\n\nTASK: [{{ env }} | debug msg=\"Hello from first\"] ****************************** \nok: [localhost] => {\n    \"msg\": \"Hello from first\"\n}\n\nPLAY [localhost] ************************************************************** \n\nGATHERING FACTS *************************************************************** \nok: [localhost]\n\nTASK: [{{ env }} | debug msg=\"Hello from second\"] ***************************** \nok: [localhost] => {\n    \"msg\": \"Hello from second\"\n}\n\nPLAY RECAP ******************************************************************** \nlocalhost                  : ok=4    changed=0    unreachable=0    failed=0\n```\n##### Actual Results:\n\n```\nERROR! 'env' is undefined\n```\n"}}
{"actor":{"display_login":"ansibotdev"}}