Bug 2269390
| Summary: | Ansible Remote Execution Is Not Honoring SSH User From Advanced Fields in Job Template | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | myoder |
| Component: | Ansible - Remote Execution | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED MIGRATED | QA Contact: | Gaurav Talreja <gtalreja> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.14.1 | CC: | ahumbe, aruzicka, nalfassi, rlavi, shwsingh, tharring, zhunting |
| Target Milestone: | stream | Keywords: | EasyFix, MigratedToJIRA, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | rubygem-foreman_ansible-13.0.4 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2024-06-06 17:25:51 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
myoder
2024-03-13 15:49:58 UTC
customer in 03757734 also reported that the override value for the ssh_user password (password field in the "Advanced fields" section) will not work when he uses "remote_execution_ssh_user" parameter on the host. I confirmed this also with my satellite. This seem to leave the only workable solution for Ansible REX with the override value for non-ssh user is to: 1) "remote_execution_ssh_user" parameter on the host 2) deploy the ssh key to the non-root user (passwdless ssh) Unless there is a different workaround like "remote_execution_ssh_user_password" parameter on the host which I tested and did not work. Verified.
Tested on Satellite Stream Snap 56.0
Version: rubygem-foreman_ansible-14.0.0-1.el9sat.noarch
Steps:
1. Ensure ssh_user and effective_user to root from the "Administer => Settings", "Remote Execution" tab
2. Register a host, and on the Hosts page, select a host, and run "Schedule Remote Job"
3. Select job category "Ansible Playbook" and Job Template "Ansible Roles - Ansible Default"
4. From the Advanced Fields, select "SSH User" to a non-root user (a user that exists on the client, and the foreman-proxy public key has been shared with)
5. verify /var/log/secure on the client to check ssh connection using which user
OR
3. Use "Ansible Playbook - Ansible Run Playbook" job with below playbook to validate ansible_user,
---
- name: Verify Ansible user
hosts: all
gather_facts: false
tasks:
- name: Display Ansible user
debug:
msg: "Ansible is running as user {{ ansible_user }}"
4. From the Advanced Fields, Select "SSH User" to a non-root user, check stdout for executed job and verify /var/log/secure on the client.
Observation:
The "SSH user" selected in the Advanced Fields of the Job Template is used correctly
I can verify that configuring the "SSH user" and the "Effective user" within the Advanced Fields of the Job Template functions correctly. However, the provided values for the "SSH password" and the "Effective user password" in the Advanced Fields of the Job Template do not work as expected. Please note that with the recent updates, if the `remote_execution_ssh_user` is defined as a host parameter, it will only be utilized if the "SSH user" is not specified in the Advanced Fields of the Job Template. This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there. Due to differences in account names between systems, some fields were not replicated. Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information. To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like: "Bugzilla Bug" = 1234567 In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information. |