You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/setup_docker_registry/handlers/cleanup.yml

32 lines
844 B
YAML

- 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
- name: "Printing registry logs"
debug: var=registry_logs.stdout_lines
- name: "Get nginx logs"
command: "docker logs {{ nginx_name }}"
register: nginx_logs
no_log: yes
- name: "Printing nginx logs"
debug: var=nginx_logs.stdout_lines
- 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