{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/13557","labels_url":"https://api.github.com/repos/ansible/ansible/issues/13557/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/13557/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/13557/events","html_url":"https://github.com/ansible/ansible/issues/13557","id":122280884,"number":13557,"title":"host_vars do not get fully loaded when using 'inventory' directory and --limit","user":{"login":"xytis","id":78025,"avatar_url":"https://avatars.githubusercontent.com/u/78025?v=3","gravatar_id":"","url":"https://api.github.com/users/xytis","html_url":"https://github.com/xytis","followers_url":"https://api.github.com/users/xytis/followers","following_url":"https://api.github.com/users/xytis/following{/other_user}","gists_url":"https://api.github.com/users/xytis/gists{/gist_id}","starred_url":"https://api.github.com/users/xytis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xytis/subscriptions","organizations_url":"https://api.github.com/users/xytis/orgs","repos_url":"https://api.github.com/users/xytis/repos","events_url":"https://api.github.com/users/xytis/events{/privacy}","received_events_url":"https://api.github.com/users/xytis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-15T14:12:26Z","updated_at":"2015-12-15T14:12:26Z","closed_at":null,"body":"##### Issue Type:\r\n  - Bug Report\r\n  - Bugfix Pull Request\r\n\r\n##### Ansible Version:\r\n  - 1.9.4\r\n  - devel\r\n\r\n##### Ansible Configuration:\r\n```\r\n[defaults]\r\ninventory=inventory\r\n```\r\n##### Environment:\r\n\r\n    ./inventory/g\r\n    ./host_vars/h1\r\n    ./host_vars/h2\r\n    ./playbook.yml\r\n\r\n##### Summary:\r\n\r\nhost_vars are not loaded when using inventory directory and --limit flag\r\n\r\n##### Steps To Reproduce:\r\n\r\n```\r\n#./inventory/g\r\nh1\r\nh2\r\n```\r\n```\r\n#./host_vars/h1\r\n---\r\nkey: h1\r\n```\r\n```\r\n#./host_vars/h2\r\n---\r\nkey: h2\r\n```\r\n```\r\n#./playbook.yml\r\n---\r\n\r\n- name: test host_vars includes\r\n  gather_facts: no\r\n  hosts: all\r\n  tasks:\r\n    - debug: var=hostvars['h1'].key\r\n    - debug: var=hostvars['h2'].key\r\n```\r\n\r\n    ansible-playbook playbook.yml -l h1\r\n\r\n##### Expected Results:\r\n\r\n```\r\nPLAY [test host_vars includes] ************************************************\r\n\r\nTASK: [debug var=hostvars['h1'].key] ******************************************\r\nok: [h1] => {\r\n    \"var\": {\r\n        \"hostvars['h1'].key\": \"h1\"\r\n    }\r\n}\r\n\r\nTASK: [debug var=hostvars['h2'].key] ******************************************\r\nok: [h1] => {\r\n    \"var\": {\r\n        \"hostvars['h2'].key\": \"h2\"\r\n    }\r\n}\r\n\r\nPLAY RECAP ********************************************************************\r\nh1                         : ok=2    changed=0    unreachable=0    failed=0\r\n```\r\n\r\n##### Actual Results:\r\n\r\n```\r\nPLAY [test host_vars includes] ************************************************\r\n\r\nTASK: [debug var=hostvars['h1'].key] ******************************************\r\nok: [h1] => {\r\n    \"var\": {\r\n        \"hostvars['h1'].key\": \"h1\"\r\n    }\r\n}\r\n\r\nTASK: [debug var=hostvars['h2'].key] ******************************************\r\nok: [h1] => {\r\n    \"var\": {\r\n        \"hostvars['h2'].key\": \"{{hostvars['h2'].key}}\"\r\n    }\r\n}\r\n\r\nPLAY RECAP ********************************************************************\r\nh1                         : ok=2    changed=0    unreachable=0    failed=0\r\n```\r\n"}}