community.general.pipx_info 模块 – 获取使用 pipx 安装的应用程序的信息
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。
要在剧本中使用它,请指定:community.general.pipx_info
。
community.general 5.6.0 中的新功能
概要
使用 pipx 在隔离的 virtualenvs 中检索有关 Python 应用程序的详细信息。
参数
参数 |
注释 |
---|---|
系统中安装的 如果未指定,该模块将使用 |
|
该模块会将
选择
|
|
在输出中包含依赖包。 选择
|
|
在输出中包含注入的包。 选择
|
|
使用 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完整 此操作不会修改状态。 |
可以在 |
|
支持: 不适用 此操作不会修改状态。 |
在差异模式下,将返回有关已更改的内容(或可能需要在 |
注意
注意
此模块需要
pipx
版本 0.16.2.1 或更高版本。从 community.general 11.0.0 开始,该模块将需要pipx>=1.7.0
。请注意,
pipx
需要 Python 3.6 或更高版本。此模块不安装
pipx
python 包,但是可以使用模块 ansible.builtin.pip 轻松完成。此模块不要求
pipx
位于 shellPATH
中,但它必须可以作为模块由 Python 加载。此模块将遵守
pipx
环境变量,例如但不限于PIPX_HOME
和PIPX_BIN_DIR
,这些变量使用 environment Ansible 关键字传递。
参见
另请参见
- C(pipx) 命令手册页
该命令的手册页。
示例
---
- name: retrieve all installed applications
community.general.pipx_info: {}
- name: retrieve all installed applications, include dependencies and injected packages
community.general.pipx_info:
include_deps: true
include_injected: true
- name: retrieve application tox
community.general.pipx_info:
name: tox
include_deps: true
- name: retrieve application ansible-lint, include dependencies
community.general.pipx_info:
name: ansible-lint
include_deps: true
返回值
常见的返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
已安装应用程序的列表 返回:成功 |
|
已安装应用程序的名称。 返回:成功 示例: |
|
已安装的应用程序是否被固定。 当使用 返回:成功 示例: |
|
已安装应用程序的版本。 返回:成功 示例: |
|
为获取已安装应用程序列表而执行的命令。 返回:成功 示例: |
|
当 返回:成功 |
|
pipx 的版本。 返回: 总是 示例: |