ansible/ansible — pull request #4285 by blair (2013-09-28 23:34:56+00:00)
Title: apt: pass child process stdout and stdout to m.fail_json() and m.exit_js...

...on().

Without this, this fails:

- name: apt-get dist-upgrade
action: apt upgrade=dist
register: apt_get_contents

- name: apt-get clean
action: command apt-get clean
when: apt_get_contents.stdout.find("0 upgraded") == -1

TASK: [apt-get clean] *********************************************************

fatal: [192.168.2.2] => error while evaluating conditional: {% if apt_get_contents.stdout.find("0 upgraded") == -1 %} True {% else %} False {% endif %}

FATAL: all hosts have already failed -- aborting