Ansible 1.9.2 version.
Does Ansible supports variable expansion within a variable while evaluating it.
I have a task to download 3 zip files from Artifactory
No it doesn't. But it doesn't mean that you have to expand it into 3 different tasks. What you can do is actually expand you "dictionary" to look similar to this:
with_items:
- {"url": "https://xxxxx", "file": "/tmp/xxxxx" }
- {"url": "https://yyyyy", "file": "/tmp/yyyyy" }
- {"url": "https://zzzzz", "file": "/tmp/zzzzz" }
Then in your task just call different parameters: {{ item.url }} and {{ item.file }}
Alternative Options:
Write your own filter that will expand your variable according to the value {{ jmeterplugins_url | my_custom_filter(item.plugin) }}
Write a custom module, that will encapsulate all of the functionality of fetching url into the file based on your inputs
Write custom lookup_plugin
that will iterate through your list of variables and produce correct result.
Since you are using command
module you can leverage bash
to concatenate your url, file in the same command ( this would probably be the messiest solution )