community.general.pipx_info (8.5.0) — module

Rretrieves information about applications installed with pipx

| "added in version" 5.6.0 of community.general"

Authors: Alexei Znamensky (@russoz)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Retrieve details about Python applications installed in isolated virtualenvs using pipx.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: retrieve all installed applications
  community.general.pipx_info: {}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: retrieve all installed applications, include dependencies and injected packages
  community.general.pipx_info:
    include_deps: true
    include_injected: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: retrieve application tox
  community.general.pipx_info:
    name: tox
    include_deps: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: retrieve application ansible-lint, include dependencies
  community.general.pipx_info:
    name: ansible-lint
    include_deps: true

Inputs

    
name:
    description:
    - Name of an application installed with C(pipx).
    type: str

executable:
    description:
    - Path to the C(pipx) installed in the system.
    - 'If not specified, the module will use C(python -m pipx) to run the tool, using
      the same Python interpreter as ansible itself.

      '
    type: path

include_raw:
    default: false
    description:
    - Returns the raw output of C(pipx list --json).
    - The raw output is not affected by O(include_deps) or O(include_injected).
    type: bool

include_deps:
    default: false
    description:
    - Include dependent packages in the output.
    type: bool

include_injected:
    default: false
    description:
    - Include injected packages in the output.
    type: bool

Outputs

application:
  contains:
    dependencies:
      description: The dependencies of the installed application, when O(include_deps=true).
      elements: str
      returned: success
      sample:
      - virtualenv
      type: list
    injected:
      description: The injected packages for the installed application, when O(include_injected=true).
      returned: success
      sample:
        licenses: 0.6.1
      type: dict
    name:
      description: The name of the installed application.
      returned: success
      sample: tox
      type: str
    version:
      description: The version of the installed application.
      returned: success
      sample: 3.24.0
      type: str
  description: The list of installed applications
  elements: dict
  returned: success
  type: list
cmd:
  description: Command executed to obtain the list of installed applications.
  elements: str
  returned: success
  sample:
  - /usr/bin/python3.10
  - -m
  - pipx
  - list
  - --include-injected
  - --json
  type: list
raw_output:
  description: The raw output of the C(pipx list) command, when O(include_raw=true).
    Used for debugging.
  returned: success
  type: dict