1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/setup_docker_registry/handlers/cleanup.yml

38 lines
965 B
YAML
Raw Normal View History

2020-03-09 10:11:07 +01:00
- name: "Make sure all images are removed"
docker_image:
name: "{{ item }}"
state: absent
with_items: "{{ inames }}"
- name: "Get registry logs"
command: "docker logs {{ registry_name }}"
register: registry_logs
no_log: yes
ignore_errors: yes
2020-03-09 10:11:07 +01:00
- name: "Printing registry logs"
debug:
var: registry_logs.stdout_lines
when: registry_logs is not failed
2020-03-09 10:11:07 +01:00
- name: "Get nginx logs"
command: "docker logs {{ nginx_name }}"
register: nginx_logs
no_log: yes
ignore_errors: yes
2020-03-09 10:11:07 +01:00
- name: "Printing nginx logs"
debug:
var: nginx_logs.stdout_lines
when: nginx_logs is not failed
2020-03-09 10:11:07 +01:00
- name: "Make sure all containers are removed"
docker_container:
name: "{{ item }}"
state: absent
force_kill: yes
with_items: "{{ cnames }}"
register: result
retries: 3
delay: 3
until: result is success
- name: "Make sure all volumes are removed"
command: "docker rm -f {{ item }}"
with_items: "{{ vnames }}"
ignore_errors: yes