# Passing a var file into "EXTRA VARIABLES"

**URL:** <https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046>\
**Category:** AWX Project\
**Created:** [November 16, 2017, 6:05pm UTC](https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046 "2017-11-16T18:05:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturnerr1982](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jturnerr1982](https://forum.ansible.com/u/jturnerr1982)\
**Post date:** [November 16, 2017, 6:05pm UTC](https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046/1 "2017-11-16T18:05:38Z")

</div>

Hi

just setting up tower here, one thing that really has me stumped that I hope there is a simple solution to is how to pass veritable FILES into EXTRA VARIABLES when creating templates. usually when I run a playbook I pass in a fair few files like so --extra-vars @/home/ansible/playbooks/files.yml --extra-vars @./home/ansible/playbooks/files2.yml etc. The extra vars only seems to let you pass in the pairs as they are in stated files, no option to put the files in.

Any ideas on how I can fix this? Loving the rest of it, there is just this one annoying flaw I would love to get round!

Thanks

---

<div class="post-metadata">

**Author:** ![Bill\_Nottingham1](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@Bill\_Nottingham1](https://forum.ansible.com/u/Bill_Nottingham1)\
**Post date:** [November 16, 2017, 6:09pm UTC](https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046/2 "2017-11-16T18:09:53Z")

</div>

jturnerr1982@gmail.com (jturnerr1982@gmail.com) said:

> Hi
> 
> just setting up tower here, one thing that really has me stumped that I  
> hope there is a simple solution to is how to pass veritable FILES into  
> EXTRA VARIABLES when creating templates. usually when I run a playbook I  
> pass in a fair few files like so --extra-vars  
> @/home/ansible/playbooks/files.yml --extra-vars  
> @./home/ansible/playbooks/files2.yml etc. The extra vars only seems to let  
> you pass in the pairs as they are in stated files, no option to put the  
> files in.
> 
> Any ideas on how I can fix this? Loving the rest of it, there is just this  
> one annoying flaw I would love to get round!

Cut and paste the content, there's not another way. If they're in your  
source control, move them to group\_vars/host\_vars?

Bill

---

<div class="post-metadata">

**Author:** ![Bill\_Nottingham1](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@Bill\_Nottingham1](https://forum.ansible.com/u/Bill_Nottingham1)\
**Post date:** [November 16, 2017, 6:12pm UTC](https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046/3 "2017-11-16T18:12:21Z")

</div>

Bill Nottingham (notting@redhat.com) said:

> jturnerr1982@gmail.com (jturnerr1982@gmail.com) said:  
> \> Hi  
> \>  
> \> just setting up tower here, one thing that really has me stumped that I  
> \> hope there is a simple solution to is how to pass veritable FILES into  
> \> EXTRA VARIABLES when creating templates. usually when I run a playbook I  
> \> pass in a fair few files like so --extra-vars  
> \> @/home/ansible/playbooks/files.yml --extra-vars  
> \> @./home/ansible/playbooks/files2.yml etc. The extra vars only seems to let  
> \> you pass in the pairs as they are in stated files, no option to put the  
> \> files in.  
> \>  
> \> Any ideas on how I can fix this? Loving the rest of it, there is just this  
> \> one annoying flaw I would love to get round!
> 
> Cut and paste the content, there's not another way. If they're in your  
> source control, move them to group\_vars/host\_vars?

... although if you're creating the job templates via tower-cli, @\<filename\>  
will work.

Bill

---

<div class="post-metadata">

**Author:** ![jturnerr1982](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jturnerr1982](https://forum.ansible.com/u/jturnerr1982)\
**Post date:** [November 16, 2017, 6:29pm UTC](https://forum.ansible.com/t/passing-a-var-file-into-extra-variables/26046/4 "2017-11-16T18:29:46Z")

</div>

Thanks for the quick response Bill,

That is bloody annoying actually, the way everything we have structured all depends on those extra vars getting called in at the last minute. If they are manually in the job template then we will have troubles when things change. I will check out the tower CLI hopefully that will be my savior!

thanks again
