Module - docker_facts¶
This module provides for the following ansible plugin:
docker_facts
Module Documentation¶
Gather a list of volumes, images, and containers on a running system
Return both filtered and unfiltered lists of volumes, images, and containers.
Options¶
- image_filter
List of k=v pairs to use as a filter for images.
- volume_filter
List of k=v pairs to use as a filter for volumes.
- container_filter
List of k=v pairs to use as a filter for containers.
Authors¶
Example Tasks¶
- docker_facts: null
name: Gather Docker facts
- docker_facts:
container_filter:
- status=exited
- status=dead
image_filter:
- dangling=true
volume_filter:
- dangling=true
name: Gather filtered Docker facts
- docker_container:
name: '{{ item }}'
state: absent
loop: '{{ docker.containers_filtered | map(attribute=''id'') | list }}'
name: Remove containers that matched filters