# Cant call hostvars variables from a task in a role

**URL:** <https://forum.ansible.com/t/cant-call-hostvars-variables-from-a-task-in-a-role/16640>\
**Category:** Ansible Project\
**Created:** [October 29, 2014, 9:05pm UTC](https://forum.ansible.com/t/cant-call-hostvars-variables-from-a-task-in-a-role/16640 "2014-10-29T21:05:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandro\_Reox](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@Leandro\_Reox](https://forum.ansible.com/u/Leandro_Reox)\
**Post date:** [October 29, 2014, 9:05pm UTC](https://forum.ansible.com/t/cant-call-hostvars-variables-from-a-task-in-a-role/16640/1 "2014-10-29T21:05:54Z")

</div>

Folks,

Were dealing with some weird issue that we want to clarify, clearly were understanding something wrong

Heres is our current playbook distribution, with roles and stuff

deploy/  
├── ansible.cfg  
├── filter\_plugins  
│ ├── search\_hostvars.py  
│ └── search\_hostvars.pyc  
├── group\_vars  
│ ├── all  
├── install\_ansible.sh  
├── inventory  
│ └── inventory  
├── openstack.yaml  
├── roles  
│ ├── apt-cacher  
│ │ ├── defaults  
│ │ │ ├── main.yaml  
│ │ │ └── trackfile  
│ │ ├── files  
│ │ │ └── trackfile  
│ │ ├── handlers  
│ │ │ └── trackfile  
│ │ ├── meta  
│ │ │ └── trackfile  
│ │ ├── tasks  
│ │ │ ├── main.yaml  
│ │ │ └── trackfile  
│ │ ├── templates  
│ │ │ ├── etc  
│ │ │ │ └── apt  
│ │ │ │ └── apt.conf.d  
│ │ │ │ └── 000apt-cacher-ng-proxy  
│ │ │ └── trackfile  
│ │ ├── trackfile  
│ │ └── vars  
│ │ ├── main.yaml  
│ │ └── trackfile

In the apt-cacher role task main.yaml we have :
