Passing a var file into "EXTRA VARIABLES"

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

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

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

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