title: Ansible looping when a variable has no value
body: <p>I have created a variable to disable sites in nginx within my main set of tasks. Since this is a one time task, meaning once domain1.com is disabled I can comment the entire line out. When I do, I receive an error </p>
  
  <p><em>" {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'None' has no attribute 'domain'".</em></p>
  
  <p>What can I do to modify my task to only run when there are domains listed within the variable?</p>
  
  <pre><code>nginx_sites_disabled:
  #- domain: "domain1.com"
  
  - name: Disable sites
      file:
      path: /etc/nginx/sites-enabled/{{ item.domain }}
      state: absent
    with_items: "{{nginx_sites_disabled}}"
    notify:
    - Reload nginx
  </code></pre>