title: Use conditional when statement in Ansible, to only run a task in playbook when a certain version of a package is called
body: <p>Hi I am new to Ansible and what I want to do something like this:</p>
  <p>for example -</p>
  <p>the task in my playbook:</p>
  <pre><code>    - name: install one specific version of Apache
        yum:
          name: httpd-{{ version }}
          state: present
          when: {{ version }} ==  2.2.29-1.4.amzn1
  </code></pre>
  <p>The variables in my Vars file :</p>
  <pre><code>version: 
      - 2.2.29-1.4.amzn1
      - 2.2.30-1.5.amzn1
      - 2.3.31-1.6.amzn1 
     so on .....
  </code></pre>
  <p>So I want the task to only run when I pass in a specific version of Apache, no matter where it is in that list of versions. In this case its  2.2.29-1.4.amzn1.</p>