Bug 1698178

Summary: [RFE] Allow the use of Ansible Runner instead of Ansible
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: Ansible - Configuration ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: egolov, mhulan, mmccune, pcreech, vgrosu
Target Milestone: 6.6.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_ansible-3.0.2, tfm-rubygem-foreman_remote_execution-1.7.1, tfm-rubygem-foreman_remote_execution_core-1.1.6, tfm-rubygem-foreman_ansible_core-3.0.0, ansible-runner-1.3.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 12:47:18 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:
Bug Depends On: 1730344    
Bug Blocks:    

Description Bryan Kearney 2019-04-09 18:11:35 UTC
[RFE] Allow the use of Ansible Runner instead of Ansible

Comment 3 Bryan Kearney 2019-05-20 15:26:17 UTC
*** Bug 1698179 has been marked as a duplicate of this bug. ***

Comment 14 Lukas Pramuk 2019-08-08 12:52:24 UTC
VERIFIED.

@Satellite-6.6.0 Snap14
tfm-rubygem-foreman_ansible-3.0.3-3.el7sat.noarch
tfm-rubygem-foreman_ansible_core-3.0.0-1.el7sat.noarch
ansible-runner-1.3.4-2.el7ar.noarch
ansible-2.8.3-1.el7ae.noarch

by the following testing procedure:

# curl -k https://$(hostname):9090/ssh/pubkey >> ~/.ssh/authorized_keys

# yum install ansible-runner
...

Installed:
  ansible-runner.noarch 0:1.3.4-2.el7ar                                                                                 

Dependency Installed:
  libwebp.x86_64 0:0.3.0-7.el7                            python-docutils.noarch 0:0.11-0.3.20130715svn7687.el7         
  python-pillow.x86_64 0:2.0.0-19.gitd1c6db8.el7          python-psutil.x86_64 0:5.0.1-3.el7sat                         
  python2-ansible-runner.noarch 0:1.3.4-2.el7ar           python2-daemon.noarch 0:2.1.2-7.el7at                         
  python2-lockfile.noarch 1:0.11.0-10.el7ar               python2-pexpect.noarch 0:4.6-1.el7at                          
  python2-ptyprocess.noarch 0:0.5.2-3.el7at              

# hammer settings set --name ansible_implementation --value ansible-runner
Setting [ansible_implementation] updated to [ansible-runner].

# hammer job-invocation create --job-template 'Run Command - Ansible Default' --inputs 'command=uname -a' --search-query "name ^ $(hostname)"
Job invocation 1 created
[...............................................................................................................] [100%]
1 task(s), 1 success, 0 fail

# hammer job-invocation output --id 1 --host $(hostname)


PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************

ok: [<HOST_FQDN>]

TASK [shell] *******************************************************************

changed: [<HOST_FQDN>]

TASK [debug] *******************************************************************

ok: [<HOST_FQDN>] => {
    "out": {
        "changed": true, 
        "cmd": "uname -a\n", 
        "delta": "0:00:00.003244", 
        "end": "2019-08-08 08:22:07.402830", 
        "failed": false, 
        "rc": 0, 
        "start": "2019-08-08 08:22:07.399586", 
        "stderr": "", 
        "stderr_lines": [], 
        "stdout": "Linux <HOST_FQDN> 3.10.0-957.27.2.el7.x86_64 #1 SMP Tue Jul 9 16:53:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux", 
        "stdout_lines": [
            "Linux <HOST_FQDN> 3.10.0-957.27.2.el7.x86_64 #1 SMP Tue Jul 9 16:53:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux"
        ]
    }
}
PLAY RECAP *********************************************************************
<HOST_FQDN> : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
Exit status: 0

>>> REX using ansible-runner implementation works as expected

# hammer settings set --name ansible_implementation --value ansible-playbook
Setting [ansible_implementation] updated to [ansible-playbook].

# hammer job-invocation create --job-template 'Run Command - Ansible Default' --inputs 'command=uname -a' --search-query "name ^ $(hostname)"
Job invocation 2 created
[...............................................................................................................] [100%]
1 task(s), 1 success, 0 fail

>>> After switching back to ansible-playbook REX works as expected

Comment 16 errata-xmlrpc 2019-10-22 12:47:18 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-2019:3172