---
- name: Send status on IRC
  hosts: outpost.ping.local

  tasks:

  - name: Check failed tasks
    command: '/usr/bin/bash /home/lukasz/progi/ansible/helpers/check_failed.sh'
    register: fails

  - name: Send a report to a linuxlab channel
    irc:
      server: irc.freenode.net
      port: 6667
      nick: raport
      channel: '#linuxlab-pw'
      msg: "[ANSIBLE] Todays failed tasks: {{ fails['stdout_lines'][0] }}."