This module provides for the following ansible plugin:
- docker_facts
Gather a list of volumes, images, and containers on a running system
Return both filtered and unfiltered lists of volumes, images, and containers.
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. |
: |
---|
- 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
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.