containers / containers.podman / 1.12.1 / module / podman_prune Allows to prune various podman objects | "added in version" 1.10.0 of containers.podman" Authors: Roberto Alfieri (@rebtoor)containers.podman.podman_prune (1.12.1) — module
Install with ansible-galaxy collection install containers.podman:==1.12.1
collections: - name: containers.podman version: 1.12.1
Allows to run C(podman container prune), C(podman image prune), C(podman network prune), C(podman volume prune) and C(podman system prune)
- name: Prune containers older than 24h containers.podman.podman_prune: containers: true containers_filters: # only consider containers created more than 24 hours ago until: 24h
- name: Prune everything containers.podman.podman_prune: system: true
- name: Prune everything (including non-dangling images) containers.podman.podman_prune: system: true system_all: true system_volumes: true
image: default: false description: - Whether to prune images. type: bool system: default: false description: - Whether to prune unused pods, containers, image, networks and volume data type: bool volume: default: false description: - Whether to prune volumes. type: bool network: default: false description: - Whether to prune networks. type: bool container: default: false description: - Whether to prune containers. type: bool executable: default: podman description: - Podman binary. type: str system_all: default: false description: - Whether to prune all unused images, not only dangling images. type: bool image_filters: description: - A dictionary of filter values used for selecting images to delete. - 'You can also use C(dangling_only: false) to delete dangling and non-dangling images or C(external: true) to delete images even when they are used by external containers.' - See L(the podman documentation, https://docs.podman.io/en/latest/markdown/podman-image-prune.1.html#filter-filters) for more information on possible filters. type: dict system_volumes: default: false description: - Whether to prune volumes currently unused by any container. type: bool volume_filters: description: - A dictionary of filter values used for selecting volumes to delete. - See L(the podman documentation, https://docs.podman.io/en/latest/markdown/podman-volume-prune.1.html#filter) for more information on possible filters. type: dict network_filters: description: - A dictionary of filter values used for selecting networks to delete. - See L(the podman documentation, https://docs.podman.io/en/latest/markdown/podman-network-prune.1.html#filter) for more information on possible filters. type: dict container_filters: description: - A dictionary of filter values used for selecting containers to delete. - 'For example, C(until: 24h).' - See L(the podman documentation, https://docs.podman.io/en/latest/markdown/podman-container-prune.1.html#filter-filters) for more information on possible filters. type: dict
containers: description: - List of IDs of deleted containers. elements: str returned: I(containers) is C(true) sample: [] type: list images: description: - List of IDs of deleted images. elements: str returned: I(images) is C(true) sample: [] type: list networks: description: - List of IDs of deleted networks. elements: str returned: I(networks) is C(true) sample: [] type: list system: description: - List of ID of deleted containers, volumes, images, network and total reclaimed space elements: str returned: I(system) is C(true) sample: [] type: list volumes: description: - List of IDs of deleted volumes. elements: str returned: I(volumes) is C(true) sample: [] type: list