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
patchback[bot] b56857932e
docker_login: fix internal config file storage to handle credentials for more than one registry (#1118) (#1145)
* docker_login: fix internal config file storage to handle credentials for more than one registry

* Improve setup for docker registry.

* Add second registry frontend. Add tests for #1118.

* Fix cleanup.

(cherry picked from commit 16baefd167)

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-21 08:39:57 +02:00

47 lines
1.4 KiB
YAML

---
- name: "Make sure all images are removed"
docker_image:
name: "{{ item }}"
state: absent
with_items: "{{ docker_registry_setup_inames }}"
- name: "Get registry logs"
command: "docker logs {{ docker_registry_container_name_registry }}"
register: registry_logs
no_log: yes
ignore_errors: yes
- name: "Printing registry logs"
debug:
var: registry_logs.stdout_lines
when: registry_logs is not failed
- name: "Get nginx logs for first instance"
command: "docker logs {{ docker_registry_container_name_nginx }}"
register: nginx_logs
no_log: yes
ignore_errors: yes
- name: "Get nginx logs for second instance"
command: "docker logs {{ docker_registry_container_name_nginx2 }}"
register: nginx2_logs
no_log: yes
ignore_errors: yes
- name: "Printing nginx logs for first instance"
debug:
var: nginx_logs.stdout_lines
when: nginx_logs is not failed
- name: "Printing nginx logs for second instance"
debug:
var: nginx2_logs.stdout_lines
when: nginx_logs is not failed
- name: "Make sure all containers are removed"
docker_container:
name: "{{ item }}"
state: absent
force_kill: yes
with_items: "{{ docker_registry_setup_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: "{{ docker_registry_setup_vnames }}"
ignore_errors: yes