Hello Community,
I was running a playbook on a control node with RhEL 8.7, against a managed node
with RHEL 9. The playbook ran fine, but provided me the following warning:
[DEPRECATION WARNING]: Distribution rhel 9.0 on host node1 should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility
with prior Ansible releases. A future Ansible release will default to using the
discovered platform python for this host. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html
for more information. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
One approach to take, to bring things up-to-date, is to adjust an entry in the
/etc/ansible/ansible.cfg file:
[defaults] interpreter_python=auto
No big thing, but you'll have to add that key (interpreter_python) to the file - it doesn't
already exist. And the value needs to be "auto". Place this entry in the [defaults] section
of the "ansible.cfg" file, and the warning goes away. Of course, you can always turn off
all warnings altogether - although I wouldn't recommend doing so!
Happy Wonderful Wednesday!!!
Hey Trevor,
Some addenda
After the python2 deprecation, in RHEL8 /usr/bin/python no longer points to a specific python version, as administrators/developers need to ensure their python code is compatible with whatever python version is available in the system (you might choose a default python version with alternatives --config python).
In the case of RHEL 9, you can remove the "python-unversioned-command" package and gets rid of this behaviour (no need to run alternatives --config).
HTH
Fran
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.