community.general.python_requirements_info module – Show python path and assert dependency versions
Note
This module is part of the community.general collection (version 10.0.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.python_requirements_info
.
Synopsis
Get info about available Python requirements on the target host, including listing required libraries and gathering versions.
Parameters
Parameter |
Comments |
---|---|
A list of version-likes or module names to check for installation. Supported operators: <, >, <=, >=, or ==. The bare module name like Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Show python lib/site paths
community.general.python_requirements_info:
- name: Check for modern boto3 and botocore versions
community.general.python_requirements_info:
dependencies:
- boto3>1.6
- botocore<2
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary of dependencies that did not satisfy the desired version Returned: always Sample: |
|
A list of packages that could not be imported at all, and are not installed Returned: always Sample: |
|
path to python version used Returned: always Sample: |
|
List of paths python is looking for modules in Returned: always Sample: |
|
version of python Returned: always Sample: |
|
breakdown version of python Returned: always |
|
The Returned: always Sample: |
|
The Returned: always Sample: |
|
The Returned: always Sample: |
|
The Returned: always Sample: |
|
The Returned: always Sample: |
|
A dictionary of dependencies that matched their desired versions. If no version was specified, then Returned: always Sample: |