{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3260","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3260/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3260/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3260/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/3260","id":141227995,"number":3260,"title":"template: and copy: can't locate their input files - 2.0.1.0 regression from 1.9.4","user":{"login":"jan-grant","id":12950669,"avatar_url":"https://avatars.githubusercontent.com/u/12950669?v=3","gravatar_id":"","url":"https://api.github.com/users/jan-grant","html_url":"https://github.com/jan-grant","followers_url":"https://api.github.com/users/jan-grant/followers","following_url":"https://api.github.com/users/jan-grant/following{/other_user}","gists_url":"https://api.github.com/users/jan-grant/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-grant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-grant/subscriptions","organizations_url":"https://api.github.com/users/jan-grant/orgs","repos_url":"https://api.github.com/users/jan-grant/repos","events_url":"https://api.github.com/users/jan-grant/events{/privacy}","received_events_url":"https://api.github.com/users/jan-grant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-16T10:15:41Z","updated_at":"2016-03-16T10:15:41Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n - Bug Report\r\n\r\n##### Plugin Name:\r\n\r\ntemplate, core\r\n\r\n##### Ansible Version:\r\n\r\n```\r\nansible 2.0.1.0\r\n  config file = /home/granjan/.ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### Ansible Configuration:\r\n\r\nNothing relevant\r\n\r\n##### Environment:\r\n\r\nN/A\r\n\r\n##### Summary:\r\n\r\ntest-template.yml:\r\n```\r\n- hosts: localhost\r\n  roles: \r\n  tasks:\r\n    - include: roles/test_template/tasks/test.yml\r\n```\r\n\r\nroles/test_template/defaults/main.yml:\r\n```\r\n# Empty, needs to exist on ansible 1.9.4\r\n```\r\n\r\nroles/test_template/tasks/test.yml:\r\n```\r\n- template:\r\n    dest: /tmp/template.out\r\n    src: template.out.j2\r\n```\r\n\r\nroles/test_template/templates/template.out.j2:\r\n```\r\nJust a trivial template\r\n```\r\n\r\nThe above fails to find template.out.j2\r\n\r\n##### Steps To Reproduce:\r\n\r\n```\r\n% ansible-playbook test-template.yml\r\n [WARNING]: provided hosts list is empty, only localhost is available\r\n\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [localhost]\r\n\r\nTASK [include] *****************************************************************\r\nincluded: /path/to/playbook_dir/roles/test_template/tasks/test.yml for localhost\r\n\r\nTASK [template] ****************************************************************\r\nfatal: [localhost]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"IOError: [Errno 2] No such file or directory: u'/path/to/playbook_dir/template.out.j2'\"}\r\n        to retry, use: --limit @test-template.retry\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=2    changed=0    unreachable=0    failed=1   \r\n\r\n```\r\n\r\n##### Expected Results:\r\n\r\nOn ansible 1.9.4, the correct template file is located relative to the role/task that contains the template: operation.\r\n\r\ncopy: is also affected by this.\r\n\r\n##### Actual Results:\r\n\r\nSee above."}}