Adding "Quite" mode to ignore_errors

Hi All,

I am writing the playbook that involves installing rpms without yum. Since I want to istall rpms without dependances, I am using the following trick to make it work:

  • name: “Check if foo package is installed”
    action: shell /bin/rpm -q --quiet foo ; echo $?
    register: foo_installed

  • name: “Install foo package”
    action: shell /usr/bin/yumdownloader --destdir=/tmp foo && /bin/rpm --nodeps -Uv /tmp/foo*.rpm
    only_if: “${foo_installed.stdout} != 0”

Of course I can use “ignore_errors: True” and check for foo_installed.rc, but in this case I will get the “Red Error Message” which is confusing.
I am expecting “Check if foo package is installed” task to fail at least during initial run and only need foo_installed.rc for the “next” task.

What do you think about adding “ignore_errors: Quite” that will behave as follows:

if return code is zero - always show task as “o.k”
if return code is not zero - show task as modified and hide output error.
register: foo - will be used to determine the output and return code as regular.

Well, I'm pretty sure it's "quiet" :slight_smile:

But I'm not really interested in that.

I do think the message should only be yellow and say "error hit,
ignoring...", which is what I thought it did.

Patches for that would be accepted.