Showing results for 
Search instead for 
Did you mean: 
Starfighter Starfighter

Ansible - Different OS Version on Control & Managed Node

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
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:     


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!!!


Trevor "Red Hat Evangelist" Chandler
Labels (3)
0 Kudos
1 Reply
Starfighter Starfighter

Hey Trevor,

Some addenda .  You are facing this issue because the system has a configured /usr/bin/python version.

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).




0 Kudos
Join the discussion
You must log in to join this conversation.