Variables in playbook names in "include" statement

31 views
Skip to first unread message

Wojciech Korzenny

unread,
Oct 2, 2014, 8:52:30 AM10/2/14
to ansible...@googlegroups.com
Hi,

I have a playbook where I want to include another playbook which name is depended on variable passed in --extra_vars:

$ ansible-playbook test.yaml --extra_vars="variable=XYZ"

Inside test.yaml:

TASK1
TASK2

-include: another_playbook_{{variable}}.yaml

TASK3
TASK4



The problem is that ansible throws exception that "another_playbook_{{variable}}.yaml" doesn't exist instead of substitute "{{variable}}" with value given in command line (I expect to execute another_playbook_XYZ.yaml).
Do you see any possibility to work around it?

Thanks

James Cammarata

unread,
Oct 3, 2014, 2:56:23 PM10/3/14
to ansible...@googlegroups.com
Hi Wojciech, 

Please see the response I just sent to Alexey here in this thread: https://groups.google.com/forum/#!topic/ansible-project/NWnFOzR9Ajc

The problem you're running into has the same underlying cause.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e03c573f-93a8-454e-8b46-9d2279e1e9dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages