I want to be able to apply DRY and not have to repeat myself when building my jinja2 template. So I would like to be able to reference a variable within the jinja2 template from a dynamically constructed variable name, eg:
{% for a in [ 'a', 'b', 'c'] %}
{% set name = a + "_name" %}
{% set value = {{ name }} %}
hello there {{ value }}
{% endfor %}
where my input variables into jinja would be
a_name = 1
b_name = 2
c_name = 3
and I the result would be
hello there 1
hello there 2
hello there 3
is this possible?
I know i would just pass in a datastructure into jinja2 to do something similar, but I am not at liberty to modify what goes into the template.