I am running Ansible on a host machine and I get the following warning:
TASK [Gathering Facts] *********************************************************
[DEPRECATION WARNING]: Distribution fedora 35 on host xxx.xxx.xxx.xxx should use
/usr/bin/python3, 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-
core/2.11/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.
How can I change this from using python to python3?
Ansible is telling you it is still using the /usr/bin/python path and you really cannot easily change that.
On my system that is
$ ls -l /usr/bin/python
lrwxrwxrwx. 1 root root 9 Aug 31 08:36 /usr/bin/python β ./python3
As it tells you
Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg