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 2203239 - The ssh-user and password inputs per job is not being honored for Ansible based Remote Executions
Summary: The ssh-user and password inputs per job is not being honored for Ansible bas...
Keywords:
Status: CLOSED DUPLICATE of bug 2153727
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.13.0
Hardware: All
OS: All
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-11 15:35 UTC by Sayan Das
Modified: 2023-11-10 08:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-23 08:44:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sayan Das 2023-05-11 15:35:51 UTC
Description of problem:

When I am using hammer to create a job or using GUI to create a job and trying to specify SSH user \ Effective User and passwords, 

The job will be successful for 'Run Command - Script Default' template as it honors the SSH user inputs 

The job will fail for 'Run Command - Ansible Default' template, as SSH user inputs are not accepted and Ansible tries to SSH to the host via root user only

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

Satellite 6.13.0

How reproducible:

Always

Steps to Reproduce:
1. Install a Satellite 6.13

2. Register a client system ( say name client.example.com )

3. Follow https://access.redhat.com/solutions/2650071 to setup REX based on Non-ROOT users

4. Try to Run two jobs on the client.example.com system using hammer or Satellite UI while specifying Effective User\SSH User and their passwords on the Job invocation page itself.

hammer job-invocation create --job-template 'Run Command - Ansible Default' --inputs 'command=uptime' --search-query "name = client.example.com" --organization RedHat --location GSS --ssh-user rexuser --password password --effective-user root --effective-user-password redhat


hammer job-invocation create --job-template 'Run Command - Script Default' --inputs 'command=uptime' --search-query "name = client.example.com" --organization RedHat --location GSS --ssh-user rexuser --password password --effective-user root --effective-user-password redhat


Actual results:

Job started by the first hammer command will fail
Job started by the second hammer command will be successful. 

If we take a look at the Failed Job from the Monitor --> Jobs page, It will show that 

SSH User: rexuser

Run Command - Ansible Default effective user  : root

But then if we actually check the dynflow console of the task, I see 

        ansible_user: root
        ansible_become_method: sudo
        ansible_port: 22
        ansible_host: client.example.com
        ansible_ssh_port: 22
        ansible_ssh_user: root
        ansible_roles_check_mode: false
        remote_execution_ssh_user: root
        remote_execution_effective_user_method: sudo

So for some reason, The ansible based jobs are not honoring the inputs. 


Expected results:

Ansible-based jobs should honor the per-job inputs properly. 


Additional info:

The same can be easily reproduced from Sat WebUI

Comment 1 Adam Ruzicka 2023-05-15 08:41:38 UTC
This seems to be ansible specific?

Comment 2 Sayan Das 2023-05-15 08:45:56 UTC
Yes true.. But I selected Remote Execution as It's about not using the inputs about that ssh_user\password that we pass during Job Invokation. I am fine with either as long as the right team helps to fix the issue.

I noticed you already switched the component to Ansible, so we should be good here.

Comment 3 Sayan Das 2023-05-18 08:35:45 UTC
Related BZ

2153727 – Ansible Command ignores advance field
https://bugzilla.redhat.com/show_bug.cgi?id=2153727


And both the Bugs perhaps affects 6.11 - 6.13

Comment 5 Sayan Das 2023-05-23 08:44:26 UTC
Closing this BZ as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2153727

*** This bug has been marked as a duplicate of bug 2153727 ***


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