Note
This plugin is part of the community.general collection (version 2.0.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.pip_package_info
.
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
clients list / elements=string | Default: ["pip"] | A list of the pip executables that will be used to get the packages. They can be supplied with the full path or just the executable name, i.e `pip3.7`. |
- name: Just get the list from default pip community.general.pip_package_info: - name: Get the facts for default pip, pip2 and pip3.6 community.general.pip_package_info: clients: ['pip', 'pip2', 'pip3.6'] - name: Get from specific paths (virtualenvs?) community.general.pip_package_info: clients: '/home/me/projec42/python/pip3.5'
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
packages dictionary | always | a dictionary of installed package data | |
python dictionary | always | A dictionary with each pip client which then contains a list of dicts with python package information Sample: {'packages': {'pip': {'Babel': [{'name': 'Babel', 'source': 'pip', 'version': '2.6.0'}], 'Flask': [{'name': 'Flask', 'source': 'pip', 'version': '1.0.2'}], 'Flask-SQLAlchemy': [{'name': 'Flask-SQLAlchemy', 'source': 'pip', 'version': '2.3.2'}], 'Jinja2': [{'name': 'Jinja2', 'source': 'pip', 'version': '2.10'}]}}} |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/general/pip_package_info_module.html