title: Print string when "item exists in a list" in Jinja2 template
body: <p>I'm trying to populate nsswitch.conf with values that are determined from a list. The list is of string:</p>
  
  <pre><code>openldap_nsswitch:
    - group
    - hosts
    - passwd
    - shadow
  </code></pre>
  
  <p>If the string is in the list I want to output something in the template.</p>
  
  <pre><code>passwd:         compat {% if openldap_nsswitch contains passwd %}ldap{% endif %}
  </code></pre>
  
  <p>How can I write a string only if my list contains a specific element?</p>