Most Ansible modules that execute under a POSIX environment require a Python interpreter on the target host. Unless configured otherwise, Ansible will attempt to discover a suitable Python interpreter on each target host the first time a Python module is executed for that host.
To control the discovery behavior:
ansible_python_interpreter inventory variableinterpreter_python key in the [defaults] section of ansible.cfg
Configure a path to a specific Python interpreter, or one of the following values:
Searches the configurable list of common Python interpreter paths (see INTERPRETER_PYTHON_FALLBACK) and issues a warning that future installation of another Python interpreter could alter the one chosen.
Deprecated alias for auto.
Same as auto, but does not issue warnings.
Deprecated alias for auto_silent.
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html