pytoccaz / pytoccaz.utils / 1.4.0 / module / python_module_info Checks whether a python module is installed or not | "added in version" 1.1.0 of pytoccaz.utils" Authors: Olivier Bernard (@pytoccaz)pytoccaz.utils.python_module_info (1.4.0) — module
Install with ansible-galaxy collection install pytoccaz.utils:==1.4.0
collections: - name: pytoccaz.utils version: 1.4.0
Checks a python module or package is available on target host
importlib.util.find_spec wrapper
- name: Is python-docker available ? pytoccaz.utils.python_module_info: name: docker register: module_docker
- debug: var: module_docker.is_installed
- name: Is html.parser available ? pytoccaz.utils.python_module_info: name: html.parser register: module_parser
- debug: var: module_parser.is_installed
- name: Is html.parser available (using package parameter) ? pytoccaz.utils.python_module_info: name: .parser package: html register: module_parser
- debug: var: module_parser.is_installed
name: aliases: - module_name - module description: - Fully qualified name of the python module or package. - Relative name preceded with a dot if used in combinaison with C(package) parameter required: true type: str version_added: 1.1.0 version_added_collection: pytoccaz.utils package: description: - Fully qualified name of the python package - Start C(name) parameter value with a dot required: false type: str version_added: 1.1.0 version_added_collection: pytoccaz.utils
is_installed: description: If the python module or package is actually installed returned: success sample: true type: bool name: description: The python module fully qualified name C(package_name.?module_name) returned: succes sample: html.parser type: str