{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/10823","labels_url":"https://api.github.com/repos/ansible/ansible/issues/10823/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/10823/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/10823/events","html_url":"https://github.com/ansible/ansible/issues/10823","id":70505473,"number":10823,"title":"file lookups behave differently in a role's main var file vs. in auxiliary var files","user":{"login":"tomconnors","id":2386992,"avatar_url":"https://avatars.githubusercontent.com/u/2386992?v=3","gravatar_id":"","url":"https://api.github.com/users/tomconnors","html_url":"https://github.com/tomconnors","followers_url":"https://api.github.com/users/tomconnors/followers","following_url":"https://api.github.com/users/tomconnors/following{/other_user}","gists_url":"https://api.github.com/users/tomconnors/gists{/gist_id}","starred_url":"https://api.github.com/users/tomconnors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomconnors/subscriptions","organizations_url":"https://api.github.com/users/tomconnors/orgs","repos_url":"https://api.github.com/users/tomconnors/repos","events_url":"https://api.github.com/users/tomconnors/events{/privacy}","received_events_url":"https://api.github.com/users/tomconnors/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P3","name":"P3","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-23T20:25:49Z","updated_at":"2015-07-12T21:00:11Z","closed_at":"2015-07-12T21:00:11Z","body":"##### Issue Type:\r\nBug Report\r\n\r\n##### Ansible Version:\r\nansible 1.9.0.1\r\n\r\n##### Environment:\r\nRunning from OSX 10.9.5\r\nTargeting Ubuntu 14.04\r\n\r\n##### Summary:\r\nUsing a file lookup in a role's main var file succeeds and an identical lookup in an auxiliary var file fails.\r\n\r\nMore specifically, I have a role with two files in the \"vars\" directory: `main.yml` and `dev.yml`. In the role's `tasks/main.yml`, the first task is to conditionally include the `dev.yml` var file using `include_vars`. The `dev.yml` file contains a lookup intended to read a file in the role's `files` directory:\r\n\r\n```\r\nkey: \"{{ lookup('file', 'ssh/phony_key.pub') }}\"\r\n```\r\n\r\nThe `main.yml` file has a lookup that reads successfully from the same `files` directory. Once the var defined using a lookup in `dev.yml` is referenced, the playbook fails because the lookup plugin was unable to find the file. \r\n\r\n##### Steps To Reproduce:\r\nCreate a role with a `dev.yml` var file. In `dev.yml` use a lookup for a file in the role's `files` directory. Include the var file using `include_vars` in the role's `tasks/main.yml`. The lookup will not succeed.\r\n\r\n##### Expected Results:\r\nI expected lookups to function identically in all sibling var files.\r\n\r\n##### Actual Results:\r\nLookups succeed in `main.yml` and fail in other files in the `vars` directory.\r\n"}}