# How to pass variables to task

**URL:** <https://forum.ansible.com/t/how-to-pass-variables-to-task/25842>\
**Category:** Ansible Project\
**Created:** [October 27, 2017, 1:06pm UTC](https://forum.ansible.com/t/how-to-pass-variables-to-task/25842 "2017-10-27T13:06:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KP1](https://avatars.discourse-cdn.com/v4/letter/k/ea666f/32.png) [@KP1](https://forum.ansible.com/u/KP1)\
**Post date:** [October 27, 2017, 1:06pm UTC](https://forum.ansible.com/t/how-to-pass-variables-to-task/25842/1 "2017-10-27T13:06:28Z")

</div>

Hi,  
Is there a way to pass multiple variables to a task? All the variables will be defined in inventory file:

For example:  
My inventory file 1 will be having variables like below:  
is\_xyz=true  
is\_abc=false  
is\_sdf=true  
…  
…

My inventory file 2 will be having variables like below:  
is\_xyz=true  
is\_mnp=true  
is\_sdf=false  
…  
…

I want to use one playbook for multiple inventory files and I dont want to change the variable names every time in playbook. I want to know if there is a way to pass variables like {{ is\_\* }} (i mean with wildcard)

Thanks
