mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Python interpreter discovery (#50163)
* Python interpreter discovery * No longer blindly default to only `/usr/bin/python` * `ansible_python_interpreter` defaults to `auto_legacy`, which will discover the platform Python interpreter on some platforms (but still favor `/usr/bin/python` if present for backward compatibility). Use `auto` to always use the discovered interpreter, append `_silent` to either value to suppress warnings. * includes new doc utility method `get_versioned_doclink` to generate a major.minor versioned doclink against docs.ansible.com (or some other config-overridden URL) * docs revisions for python interpreter discovery (cherry picked from commit 5b53c0012ab7212304c28fdd24cb33fd8ff755c2) * verify output on some distros, cleanup
This commit is contained in:
parent
b8a82f5930
commit
4d3a6123d5
20 changed files with 759 additions and 28 deletions
|
@ -39,9 +39,12 @@ command via ``python3``. For example:
|
|||
Using Python 3 on the managed machines with commands and playbooks
|
||||
------------------------------------------------------------------
|
||||
|
||||
* Set the ``ansible_python_interpreter`` configuration option to :command:`/usr/bin/python3`. The
|
||||
``ansible_python_interpreter`` configuration option is usually set as an inventory
|
||||
variable associated with a host or group of hosts:
|
||||
* Ansible will automatically detect and use Python 3 on many platforms that ship with it. To explicitly configure a
|
||||
Python 3 interpreter, set the ``ansible_python_interpreter`` inventory variable at a group or host level to the
|
||||
location of a Python 3 interpreter, such as :command:`/usr/bin/python3`. The default interpreter path may also be
|
||||
set in ``ansible.cfg``.
|
||||
|
||||
.. seealso:: :ref:`interpreter_discovery` for more information.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue