community.general.docker_stack_task_info (1.3.14) — module

Return information of the tasks on a docker stack

| "added in version" 1.1.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 tasks 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_task_info:
      name: test_stack
    register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Show results
    ansible.builtin.debug:
      var: result.results

Inputs

    
name:
    description:
    - Stack name.
    required: true
    type: str

Outputs

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

    to a stack name.

    '
  elements: dict
  returned: always
  sample: '[{"CurrentState":"Running","DesiredState":"Running","Error":"","ID":"7wqv6m02ugkw","Image":"busybox","Name":"test_stack.1","Node":"swarm","Ports":""}]

    '
  type: list