Upgrading from Rhel7-> 8 using ansible. In the pre upgrade task I performed few checks like space check and yum update and subscription-manager registration. No issues in the beginning tasks…
But when performing below task post reboot task Shell:
Yum clean all
Subscription-manager unsubscribe —all
Subscription-manager clean
It is giving me no such file /usr/bin/python
Before running the job In RHEl 7 the python version was pointing to
That is a Rhel7 to RHEL 8 change. The default python in REHL7 is Python 2.7 while RHEL 8 is python3.6. I would also consider moving the subscription tasks to community.general.redhat_subscription module. That is should automatically change python version, but you may need to disconnect and reconnect to update the user environment.
Thank you the problem is before updating to Rhel 8 also when it reboots in the last below task (line#99) the alternatives is updating to python3 link which is not present . Do you suggest to use subscription module in line#79 instead of shell?
Thank you… I ll try to use the modules instead.
And we run ansible with the root user …
also when I rebooting my server manually the default python link is getting updated to pyhon3
Now I raised the issue to RH let’s see what comes up
Well, yes. A lot of system tools, especially rpm itself, got updated
to use python3 and the updated /usr/bin/python link because python2 is
*obsolete* and no longer supported. Frankly, by the time you work out
trying nto do the update in place, you could make a full backup of the
whole OS to some separate location, done a clean installation, and
recovered necessary configurations from the backup.
Doing that kind of remotely managed update as a remotely triggered
operation is.... pretty dangerous. There are a lot of ways around it.
My favorite, from long before ansible, was to pick an underused
partition, copy everything I might care about into *that*, and
completely re-install the OS with optional re-partitioning and file
system creation with newer tools along the way.