ansible / ansible.builtin / v2.7.17 / module / python_requirements_facts Show python path and assert dependency versions | "added in version" 2.7 of ansible.builtin" Authors: Will Thames (@willthames), Ryan Scott Brown (@ryan_sb) preview | supported by communityansible.builtin.python_requirements_facts (v2.7.17) — module
pip
Install with pip install ansible==2.7.17
Get info about available Python requirements on the target host, including listing required libraries and gathering versions.
- name: show python lib/site paths python_requirements_facts:
- name: check for modern boto3 and botocore versions python_requirements_facts: dependencies: - boto3>1.6 - botocore<2
dependencies: description: 'A list of version-likes or module names to check for installation. Supported operators: <, >, <=, >=, or ==. The bare module name like I(ansible), the module with a specific version like I(boto3==1.6.1), or a partial version like I(requests>2) are all valid specifications. '
mismatched: description: A dictionary of dependencies that did not satisfy the desired version returned: always sample: botocore: desired: botocore>2 installed: 1.10.60 type: dict not_found: description: A list of packages that could not be imported at all, and are not installed returned: always sample: - boto4 - riquests type: dict python: description: path to python version used returned: always sample: /usr/local/opt/python@2/bin/python2.7 type: str python_system_path: description: List of paths python is looking for modules in returned: always sample: - /usr/local/opt/python@2/site-packages/ - /usr/lib/python/site-packages/ - /usr/lib/python/site-packages/ type: list python_version: description: version of python returned: always sample: 2.7.15 (default, May 1 2018, 16:44:08) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] type: str valid: description: A dictionary of dependencies that matched their desired versions. If no version was specified, then I(desired) will be null returned: always sample: boto3: desired: null installed: 1.7.60 botocore: desired: botocore<2 installed: 1.10.60 type: dict