ansible/awx

When Specifying ignore_unreachable: yes in a Task, AWX Inventory Host View Should Reflect Unreachable Hosts as Successful

Open

#7684 opened on Jul 21, 2020

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Python (13,071 stars) (3,333 forks)batch import
blockedcomponent:apicomponent:uihelp wantedtype:bug

Description

ISSUE TYPE
  • Feature Idea
SUMMARY

When specifying ignore_unreachable: yes in a playbook task, any hosts that were unreachable at the time show as unreachable and skipped, but not failed.

However, when you look in the AWX host inventory view, hosts that were unreachable but didn't essentially fail show as failing:

image

In the preceding example, CentOS1 was unreachable while CentOS2 was reachable. The playbook task had ignore_unreachable: yes included. The PLAY RECAP shows CentOS1 being unreachable and skipped, but not failed:

PLAY RECAP *********************************************************************
CentOS1                    : ok=0    changed=0    unreachable=1    failed=0    skipped=1    rescued=0    ignored=0   
CentOS2                    : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Oddly though, in awx-manage shell_plus, CentOS1 is showing active failures:

>>> r = Host.objects.filter(id=34)
>>> for x in r:
...     print(x.has_active_failures)
... 
True

As a test, I went into psql and manually updated main_host to change has_active_failures to False. After doing this, I verified the change via awx-manage shell_plus and re-ran the same job template.

>>> r = Host.objects.filter(id=34)
>>> for x in r:
...     print(x.has_active_failures)
... 
False

As I would expect, the job template was successful, however, CentOS1 was still marked as a failed node, even though no failures were reported in the PLAY RECAP.

I verified the reversion via awx-manage shell_plus:

>>> r = Host.objects.filter(id=34)
>>> for x in r:
...     print(x.has_active_failures)
... 
True

Per an user's request, they would like to see hosts that were marked unreachable and skipped, but not failed as successful in the AWX inventory host view.

Contributor guide