community.general.docker_stack_info (1.3.14) — module

Return information on a docker stack

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

Authors: Jose Angel Munoz (@imjoseangel)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 1.3.14

Description

Retrieve information on docker stacks using the C(docker stack) command on the target node (see examples).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Shows stack info
    community.general.docker_stack_info:
    register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Show results
    ansible.builtin.debug:
      var: result.results

Outputs

results:
  description: 'List of dictionaries containing the list of stacks or tasks associated

    to a stack name.

    '
  returned: always
  sample: '"results": [{"name":"grafana","namespace":"default","orchestrator":"Kubernetes","services":"2"}]

    '
  type: list