Add docker_image_remove module. (#732)

This commit is contained in:
Felix Fontein
2023-12-31 15:13:04 +01:00
committed by GitHub
parent 66b341aa9e
commit c3f8f80a75
27 changed files with 635 additions and 72 deletions
@@ -21,9 +21,8 @@
always:
- name: "Make sure all images are removed"
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
with_items: "{{ inames }}"
- name: "Make sure all containers are removed"
docker_container:
@@ -42,10 +42,9 @@
# All images by IDs
- name: Remove all images
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
force_absent: true
force: true
loop: "{{ all_images }}"
ignore_errors: true
register: remove_all_images
@@ -66,10 +65,9 @@
when: remove_all_images is failed
- name: Remove all images (after pruning)
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
force_absent: true
force: true
loop: "{{ all_images }}"
when: remove_all_images is failed
@@ -106,9 +104,8 @@
# Mixed images and IDs
- name: Remove all images
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
loop: "{{ all_images }}"
- name: Load all images (mixed images and IDs)
@@ -136,9 +133,8 @@
# Same image twice
- name: Remove all images
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
loop: "{{ all_images }}"
- name: Load all images (same image twice)
@@ -161,9 +157,8 @@
# Single image by ID
- name: Remove all images
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
loop: "{{ all_images }}"
- name: Load all images (single image by ID)
@@ -196,9 +191,8 @@
# All images by names
- name: Remove all images
docker_image:
docker_image_remove:
name: "{{ item }}"
state: absent
loop: "{{ all_images }}"
- name: Load all images (names)