Or better yet, provide a regex to determine if it changed. Let's say
for an apt-get dist-upgrade task to see if any packages were added:
# Need to set DEBIAN_FRONTEND=noninteractive otherwise whiptail
# can ask post-install questions that block the upgrade waiting
# for shell input, e.g. libc asking if it should restart services
# that depend upon it.
- name: DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
action: shell DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
register: apt_get_contents
changed_if: '"""${apt_get_contents.stdout}""".find("0 upgraded") == -1'
I'm using register here just to show conceptually how this would work,
but the stdout and stderr could be provided using pre-determined variables.
Blair