Bug 1943266

Summary: Failed to run ansible job when disabling "foreman_tasks_proxy_batch_trigger"
Product: Red Hat Satellite Reporter: James Jeffers <jjeffers>
Component: Tasks PluginAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6.0CC: ahumbe, anrussel, aruzicka, egolov, hakon.gislason, jjeffers, mkalyat, mmccune, saydas, smajumda, spurrier, wclark, zhunting
Target Milestone: 6.8.6Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_ansible-5.1.3.3-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1817320 Environment:
Last Closed: 2021-04-13 18:45:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Jeffers 2021-03-25 17:02:40 UTC
+++ This bug was initially created as a clone of Bug #1817320 +++

Description of problem:
Ansible job is treated as a remote execution job when disabling "foreman_tasks_proxy_batch_trigger" which causing it to fail.

Steps to Reproduce:
1. Disable batch trigger
Web UI -> Admister -> Settings -> ForemanTasks -> foreman_tasks_proxy_batch_trigger -> Se to "No"

2. Run an ansible job.

Go to Web UI -> Monitor -> Jobs -> Run Job:

Job category: Ansible Playbook
Job template: Ansible Roles - Ansible default
Search Query: *   <=== use "*" to run all hosts. or use other filter of your choice

Click "Display advanced fields" -> Concurrency level -> Set to 5 or any number you wish.
 
3. All host jobs failed with following error.

/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 1: ---: command not found
   2:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 2: -: command not found
   3:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 3: pre_tasks:: command not found
   4:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 4: -: command not found
   5:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 5: debug:: command not found
   6:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 6: var:: command not found
   7:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 7: roles:: command not found
   8:
/var/tmp/foreman-ssh-cmd-603ffeb8-a318-415a-a9a1-8e4e5208586a/script: line 8: -: command not found
   9:
Exit status: 127


Actual results:
jobs failed

Expected results:
jobs succeeded

Comment 3 Peter Ondrejka 2021-04-06 08:37:13 UTC
Verified on Satellite 6.8.6

Comment 8 errata-xmlrpc 2021-04-13 18:45:50 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 (Satellite 6.8.6 Async Bug Fix Update), 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/RHBA-2021:1181