title: Ansible Mail Callback Plugin With Items
body: <p>I'm running Ansible 2.4.1.0.  </p>
  
  <p>I have the below but for some reason I'm not getting the expected behaviour.</p>
  
  <p>Maybe I'm wrong or have assumed incorrectly?<br>
  I'm expecting the mail callback plugin to output the fail msg ("Ansible: Alert - Rogue Port {{ item }}").</p>
  
  <p>Please can someone suggest a change or workaround?</p>
  
  <hr>
  
  <pre><code>- name: check allowed ports
    tags: ports
    fail:
      msg: "Ansible: Alert - Rogue Port {{ item }}"
    with_items: "{{ ports_var.stdout_lines }}"
    failed_when:
       - "item not in ports_lookup_var"
  </code></pre>
  
  <p>As you can see below, no fail msg in the generated mail.</p>
  
  <pre><code>$&gt; ansible-playbook playbooks/rpc.yml --limit=warp.?????.local --tags ports
  
  TASK [check allowed ports] *****************************************************
  failed: [warp.?????.local] (item=127.0.0.1:1196) =&gt; {"changed": false, "failed": true, "failed_when_result": true, "item": "127.0.0.1:1196", "msg": "Ansible: Alert - Rogue Port 127.0.0.1:1196"}
  ok: [warp.?????.local] =&gt; (item=*:22)
  ok: [warp.?????.local] =&gt; (item=127.0.0.1:25)
  ok: [warp.?????.local] =&gt; (item=127.0.0.1:8090)
      to retry, use: --limit @/home/ansible/playbooks/rpc.retry
  
  PLAY RECAP *********************************************************************
  warp.gsoc.local            : ok=1    changed=1    unreachable=0    failed=1
  </code></pre>
  
  <p>The mail received.</p>
  
  <pre><code>Date: Thu, 14 Dec 2017 18:40:36 +0200 (SAST)
  From: "Ansible: node03.??????.local" &lt;root@ansible.?????.local&gt;
  To: root@ansible.??????.local
  Subject: Failed: All items completed
  
  Playbook: rpc.yml
  Task: check allowed ports
  Module: fail
  Host: node03.???????.local
  
  The following task failed:
  
          check allowed ports (fail)
  
  with the following message:
  
          All items completed
  
  A complete dump of the error:
  
          Failed: {"msg": "All items completed", "failed": true, "changed": false}
  </code></pre>