Interpreter Discovery
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:
- for individual hosts and groups, use the
ansible_python_interpreterinventory variable - globally, use the
interpreter_pythonkey in the[defaults]section ofansible.cfg
Configure a path to a specific Python interpreter, or one of the following values:
- auto (default) :
-
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.
- auto_legacy :
-
Deprecated alias for
auto. - auto_silent :
-
Same as
auto, but does not issue warnings. - auto_legacy_silent :
-
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