Bug 1589819 - when running ansible job become is not working
Summary: when running ansible job become is not working
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.4.0
Assignee: Daniel Lobato Garcia
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-11 12:55 UTC by Lukas Pramuk
Modified: 2019-11-05 23:23 UTC (History)
5 users (show)

Fixed In Version: foreman_ansible-2.2.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:17:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23279 0 Normal Closed when running ansible job become is not working 2021-02-14 13:56:38 UTC

Description Lukas Pramuk 2018-06-11 12:55:11 UTC
effective user (both real or nonsense) is ignored and root is always used.
While for SSH provider this works.

Comment 1 Lukas Pramuk 2018-06-11 12:55:16 UTC
Created from redmine issue http://projects.theforeman.org/issues/23279

Comment 4 Satellite Program 2018-07-09 16:02:49 UTC
Upstream bug assigned to dlobatog

Comment 5 Satellite Program 2018-07-09 16:02:51 UTC
Upstream bug assigned to dlobatog

Comment 6 Satellite Program 2018-07-11 16:02:45 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23279 has been resolved.

Comment 7 Lukas Pramuk 2018-07-16 13:09:26 UTC
VERIFIED.

@satellite-6.4.0-10.beta.el7sat.noarch
tfm-rubygem-foreman_ansible-2.2.3-1.el7sat.noarch
tfm-rubygem-foreman_ansible_core-2.1.0-1.el7sat.noarch
rubygem-smart_proxy_ansible-2.0.2-3.el7sat.noarch
ansible-2.6.1-1.el7ae.noarch

by the manual reproducer:

1) Have a SAT with Host registerred and setup for REX (ssh key is authorized)

2) @Host: # adduser test

3) Schedule Ansible Command job against the Host and with 
- command* [echo $USER]
- Effective user [test]

4) Check job output for the Host
100 % success
----
 1:
PLAY [all] *********************************************************************
   2:
   3:
TASK [Gathering Facts] *********************************************************
   4:
ok: [host1.example.com]
   5:
TASK [shell] *******************************************************************
   6:
changed: [host1.example.com]
   7:
   8:
TASK [debug] *******************************************************************
   9:
ok: [host1.example.com] => {
  10:
"out": {
  11:
"changed": true,
  12:
"cmd": "echo $USER",
  13:
"delta": "0:00:00.002638",
  14:
"end": "2018-07-16 08:51:55.153172",
  15:
"failed": false,
  16:
"rc": 0,
  17:
"start": "2018-07-16 08:51:55.150534",
  18:
"stderr": "",
  19:
"stderr_lines": [],
  20:
"stdout": "test",
  21:
"stdout_lines": [
  22:
"test"
  23:
]
  24:
}
  25:
}
  26:
  27:
PLAY RECAP *********************************************************************
  28:
host1.example.com : ok=3 changed=1 unreachable=0 failed=0
  29:
Exit status: 0
----

"stdout": "test"  >>> effective user was successfully applied

Comment 8 Bryan Kearney 2018-10-16 19:17:12 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, 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-2018:2927


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