# Unable to pass Role/X/Var variables to Task

**URL:** <https://forum.ansible.com/t/unable-to-pass-role-x-var-variables-to-task/26325>\
**Category:** Ansible Project\
**Created:** [December 18, 2017, 11:53pm UTC](https://forum.ansible.com/t/unable-to-pass-role-x-var-variables-to-task/26325 "2017-12-18T23:53:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogi\_Raghunathan](https://avatars.discourse-cdn.com/v4/letter/y/ee7513/32.png) [@Yogi\_Raghunathan](https://forum.ansible.com/u/Yogi_Raghunathan)\
**Post date:** [December 18, 2017, 11:53pm UTC](https://forum.ansible.com/t/unable-to-pass-role-x-var-variables-to-task/26325/1 "2017-12-18T23:53:38Z")

</div>

Hello Folks,

Trying to do a basic example for roles for generating configs. I cannot get to pass the variable to the tasks. Any help is appreciated.

$ ansible --version  
ansible 2.4.2.0  
config file = /home/cisco/ansible.cfg  
configured module search path = [u’/home/cisco/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/dist-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]

$ more roles/router/tasks/main.yml

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 19, 2017, 5:44am UTC](https://forum.ansible.com/t/unable-to-pass-role-x-var-variables-to-task/26325/2 "2017-12-19T05:44:05Z")

</div>

The filename must be main.yml, not mail.yml that you have.
