Python deprecation warning when running Ansible playbook on Red Hat Enterprise Linux 8

Solution Verified - Updated -


  • When running ansible-playbook or ansible ad-hoc commands on a Red Hat Enterprise Linux 8 you may show a python deprecation warning message.

    The following warning message will be exhibited when /usr/bin/python is present on the host.

    [DEPRECATION WARNING]: Distribution redhat 8.x on host 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.


  • Ansible 2.9
  • Red Hat Enterprise Linux 8
  • Red Hat Satellite 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content