I'm trying to create the following loop in jinja:
variable: >
[
{% for replaceme in list %}
{
'name': "{{ "string-{{replaceme}}" if replaceme == 'somevalue' else "string-something-{{replaceme}}" }}",
'sshKey': "{{ lookup(...) }}"
}
{% if not loop.last %},{% endif %}
{% endfor %}
]
but this doesn't work, any ideas? i tried different quotes, different combinations of curlies, etc.
Nested {{..}}
are not allowed.
Try: {{ "string-"+replaceme if replaceme == 'somevalue' else "string-something"+replaceme }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With