title: Print out only failed tasks - Ansible
body: <p>I have created an Ansible playbook which just checks the connection to target hosts on a specific port.
  Here is my playbook</p>
  
  <pre><code>- name: ACL check to target machines.
    hosts: all
    gather_facts: False
  
    vars:
  
      target_hosts:
        - server1 18089
        - server1 8089
        - server1 18000
  
    tasks:
      - name: execute the command
        command: "nc -vz {{ item }}"
        with_items: "{{ target_hosts }}"
  </code></pre>
  
  <p>The output i get when i execute the playbook contains both changed(success) and failed.</p>
  
  <p>In real scenario i have many number of target hosts, &amp; my output is very large.</p>
  
  <p>What i wanted here is, i want to have final report at bottom which shows only list of all failed connections between source and target.</p>
  
  <p>Thanks</p>