community.general.pipx_info 模块 – 获取使用 pipx 安装的应用程序的信息
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.pipx_info。
community.general 5.6.0 中的新增功能
概要
- 检索有关使用 pipx 在隔离的虚拟环境中安装的 Python 应用程序的详细信息。 
参数
| 参数 | 注释 | 
|---|---|
| 系统中安装的  如果未指定,则模块将使用  | |
| 该模块将  
 选择 
 | |
| 在输出中包含依赖包。 选择 
 | |
| 在输出中包含注入的包。 选择 
 | |
| 使用  | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持: 完全 此操作不会修改状态。 | 可以在  | |
| 支持: 不适用 此操作不会修改状态。 | 当处于 diff 模式时,将返回有关已更改(或可能需要在  | 
备注
注意
- 此模块需要 - pipx版本 0.16.2.1 或更高版本。从 community.general 11.0.0 开始,该模块将需要- pipx>=1.7.0。
- 请注意, - pipx需要 Python 3.6 或更高版本。
- 此模块不安装 - pipxPython 包,但是可以使用模块 ansible.builtin.pip 轻松完成此操作。
- 此模块不需要 - pipx位于 shell- PATH中,但它必须可由 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 的版本。 返回: 总是 示例:  | 
