title: Jinja: variable inside string inside if statement
body: <p>I'm trying to create the following loop in jinja:</p>
  
  <pre><code>variable: &gt;
  [
      {% for replaceme in list %}
      {
          'name': "{{ "string-{{replaceme}}" if replaceme == 'somevalue' else "string-something-{{replaceme}}" }}",
          'sshKey': "{{ lookup(...) }}"
      }
      {% if not loop.last %},{% endif %}
      {% endfor %}
  ]
  </code></pre>
  
  <p>but this doesn't work, any ideas? i tried different quotes, different combinations of curlies, etc.</p>