Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1995661 - Remote execution status is successful for any ansible based jobs even if the actual job execution has failed on the host in Satellite 6.10
Summary: Remote execution status is successful for any ansible based jobs even if the ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.10.0
Hardware: All
OS: All
medium
high
Target Milestone: 6.10.0
Assignee: Adam Ruzicka
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-19 15:14 UTC by Sayan Das
Modified: 2021-11-16 14:13 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-foreman_ansible_core-4.1.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:13:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33313 0 None None None 2021-08-20 06:40:17 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:13:30 UTC

Description Sayan Das 2021-08-19 15:14:21 UTC
Description of problem:

Remote execution status is successful for ansible based jobs even if the actual ansible-playbook execution has failed on the host 


Version-Release number of selected component (if applicable):

Satellite 6.10


How reproducible:

Always


Steps to Reproduce:
1. Build a Satellite 6.10 and register a host with the satellite

2. Setup REX keys with that host

3. Run any "Ansible COmmand" or "Ansible Playbook" based jobs or "Ansible roles" on the host 


Actual results:


Job Result shows 100% success

But if i click on each host entry to see what happened, I could see failures etc.


   1:

   2:
PLAY [all] *********************************************************************
   3:

   4:
TASK [Gathering Facts] *********************************************************
   5:
fatal: [host.example.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname host.example.com: Name or service not known", "unreachable": true}
   6:
PLAY RECAP *********************************************************************
   7:
host.example.com : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   
   8:
Exit status: 0


Expected results:


Result should reflect the correct status


Additional info:


The behavior is not observed when using non-ansible type jobs like the "Commands"  category.

Comment 4 Sayan Das 2021-08-19 15:47:39 UTC
I tested again on Sat 6.7 and cannot reproduce this behavior there.

Comment 6 Adam Ruzicka 2021-08-20 06:40:16 UTC
Created redmine issue https://projects.theforeman.org/issues/33313 from this bug

Comment 7 Bryan Kearney 2021-09-06 16:05:27 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33313 has been resolved.

Comment 10 Danny Synk 2021-10-14 14:22:32 UTC
Verified on Satellite 6.10, snap 23 (tfm-rubygem-foreman_ansible_core-4.2.0-1.el7sat.noarch).

Steps to Test:
1. Register a host to Satellite 6.10. Do not copy the foreman-proxy public key to the host.
2. Attempt to execute an Ansible remote job against the host.

Expected Results:
The host is reported as unreachable, the exit status for the job is not zero, and the job status is reported as failed on the Monitory > Jobs page of the webUI.

Actual Results:
The host is reported as unreachable and the exit status for the job is not zero:

~~~
proxy_output:
  result:
  - output_type: stdout
    output: "[WARNING]: Callback disabled by environment. Disabling the Foreman callback\r\nplugin.\n"
    timestamp: 1634220424.3178253
  - output_type: stdout
    output: "\n"
    timestamp: 1634220424.317921
  - output_type: stdout
    output: "\r\nPLAY [all] *********************************************************************\n"
    timestamp: 1634220424.3179832
  - output_type: stdout
    output: "\r\nTASK [Gathering Facts] *********************************************************\n"
    timestamp: 1634220424.3180554
  - output_type: stdout
    output: "\n"
    timestamp: 1634220424.3181298
  - output_type: stdout
    output: 'fatal: [host.example.com]: UNREACHABLE! => {"changed":
      false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added
      ''host.example.com,0.0.0.0'' (ECDSA) to the list of known
      hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
      "unreachable": true}

'
    timestamp: 1634220424.3182552
  - output_type: stdout
    output: |-
      PLAY RECAP *********************************************************************
      host.example.com : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
    timestamp: 1634220424.3184118
  exit_status: 1
~~~

The job status is also reported as failed on the Monitor > Jobs page of the webUI.

Comment 13 errata-xmlrpc 2021-11-16 14:13:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702


Note You need to log in before you can comment on or make changes to this bug.