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

Solution Verified - Updated -

Issue

  • 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 xxx.xxx.xxx.xxx 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.
    

Environment

  • 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