title: Ansible, how to use jinja2 template to access specific value in a list
body: <p>New to Jinja2 templating</p>
  
  <p>I can iterate over a list using a for conditional which is simple enough but i am trying to do the below...</p>
  
  <p>I have a variable that contains a un-ordered lists of values which are group names.  I would like to access the group_names lists/variable and check if  a specific item in this list exists and then perform an action if that value is found.</p>
  
  <pre><code>   group_names: [ "groupname1", "groupname2", "groupname3", "groupname4"]
  </code></pre>