Testing Ansible Tower connecting to RHEL 8

So i was going to do some testing with RHEL8 and i wanted to do some work with Ansible Tower connecting to my RHEL8 Box. As soon as i tried to execute my first test command from Tower it gave me a nasty error

“Identity added: /tmp/awx_43_x7CfTb/credential_2 (/tmp/awx_43_x7CfTb/credential_2)2fuad-rhel8-ss | FAILED! => {3 “changed”: false, 4 “module_stderr”: “Connection to fuad-rhel8-ss closed.\r\n”, 5 “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, 6 “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, 7 “rc”: 1278}

This is indeed true RHEL 8 Since RHEL 8 Using Python 8 but there is no /usr/bin/python. A defaulyt search gives me this

[root@fuad-rhel8-ss ~]# which python
/usr/bin/which: no python in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
[root@fuad-rhel8-ss ~]#

So Ansible 2.7 still needs python2 so lets install python2 based on the blog Here.

[root@fuad-rhel8-ss ~]# yum install python2Updating Subscription Management repositories.Updating Subscription Management repositories.Last metadata expiration check: 0:36:09 ago on Sun 09 Dec 2018 02:13:00 PM EST.Dependencies resolved.========================================================================================================== Package Arch Version Repository Size==========================================================================================================Installing: python2 x86_64 2.7.15–15.el8+2103+c6cdb4cb rhel-8-for-x86_64-appstream-beta-rpms 106 kInstalling dependencies: python2-setuptools noarch 39.0.1–10.el8+1958+74bcdd68 rhel-8-for-x86_64-appstream-beta-rpms 643 k python2-libs x86_64 2.7.15–15.el8+2103+c6cdb4cb rhel-8-for-x86_64-appstream-beta-rpms 6.0 MEnabling module streams: python27 2.7Transaction Summary==========================================================================================================Install 3 PackagesTotal download size: 6.7 MInstalled size: 28 MIs this ok [y/N]: y….Installed: python2–2.7.15–15.el8+2103+c6cdb4cb.x86_64 python2-setuptools-39.0.1–10.el8+1958+74bcdd68.noarch python2-libs-2.7.15–15.el8+2103+c6cdb4cb.x86_64Complete![root@fuad-rhel8-ss ~]# which python/usr/bin/which: no python in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

Still no python but following the blog post we do

[root@fuad-rhel8-ss ~]# alternatives — set python /usr/bin/python2
[root@fuad-rhel8-ss ~]# which python

and we know have python2 as the default interpreter for the apps. Now Lets test my ansible Tower connection to the host works

Hopefully this has helped understand the direction of decoupling /usr/bin/python in RHEL 8 and how existing ansible and ansible Tower users can use ansible against RHEL 8

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store