> Is there anything in jinja templating to "eval" a variable name? Where I 
> can add a string to a variable, and reference another variable
> I'm interesting in doing something like this (example pseudocode)

I did this recently for testing a lookup plugin; I think it's along the
lines of what you want:

        {% for name in names -%}

        {# Build param consisting of key and file= #}
        {%
            set param = ' '.join(( name, "file=input.csv", "default=OhNo!", 
"delimiter=;"))
        -%}
        {% set val = lookup('csvfile', param) -%}
        {{ name }} is in fact "{{ val }}"
        {% endfor %}

using the variables you want, of course. :)

        -JP

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to