title: Prevent ansible from evaluating variable when skipping a task
body: <p>I have a conditionally run role in a playbook. Like this:</p>
  
  <pre><code>  - { role: some_role, when: "some_var == 'blah'" }
  </code></pre>
  
  <p>It's annoying that even though the conditional is on the role, ansible still decides to go through every task in the role and mention:</p>
  
  <pre><code>TASK: [some_role | do something] ********************************
  skipping: [some_host]
  </code></pre>
  
  <p>Why it needs to go into each task in the role is beyond me, but that's been something I've just lived with. Until now. I just added a task to <code>some_role</code> that looks like this:</p>
  
  <pre><code>- name: do something
    some_module:
      something: "{{ item.0.some_sub_attr }}"
      something_else: "{{ item.1 }}"
    with_subelements:
      - elem1
      - elem2
  </code></pre>
  
  <p>Now, for some ungodly reason ansible is trying to evaluate <code>elem1</code> (even though it's skipping the task) and because <code>elem1</code> is undefined, it's erroring out the whole thing with:</p>
  
  <pre><code>fatal: [some_host] =&gt; subelements lookup expects a dictionary, got 'elem1'
  </code></pre>
  
  <p>How can I avoid this happening? Ideally, I'd love to get rid of all the skips on tasks and just have it tell me it's skipping the role, but if that's unavoidable, can I at least do something to stop having it evaluate variables on tasks that are being skipped anyway?</p>