This commit is contained in:
parent
c3ab086a5c
commit
c339ca0fd2
@ -1,3 +1,20 @@
|
|||||||
|
- name: Get current running containers
|
||||||
|
community.docker.docker_host_info:
|
||||||
|
containers: yes
|
||||||
|
register: docker_info
|
||||||
|
|
||||||
|
- name: Stop/Remove all current containers
|
||||||
|
communit.docker.docker_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ docker_info.containers | map(attribute='Id') | list }}"
|
||||||
|
|
||||||
|
- name: Prune everything
|
||||||
|
community.docker.docker_prune:
|
||||||
|
containers: yes
|
||||||
|
images: yes
|
||||||
|
volumes: yes
|
||||||
|
|
||||||
- name: Create Docker volumes
|
- name: Create Docker volumes
|
||||||
community.docker.docker_volume:
|
community.docker.docker_volume:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user