Switch to collect-container-logs
This change switches the post bits to use a new centralized role to collect all container logs. Depends-On: https://review.opendev.org/701867 Change-Id: I74209fe9b2294709bbef37560d93d63a86c36a10
This commit is contained in:
parent
bd64aa2631
commit
cf69b2ecfa
@ -1,17 +1,3 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
tasks:
|
roles:
|
||||||
- name: List containers
|
- collect-container-logs
|
||||||
command: "docker ps -a --format '{{ '{{ .Names }}' }}'"
|
|
||||||
register: docker_containers
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Create container log dir
|
|
||||||
file:
|
|
||||||
path: "{{ ansible_user_dir }}/zuul-output/logs/docker"
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Save container logs
|
|
||||||
loop: "{{ docker_containers.stdout_lines | default([]) }}"
|
|
||||||
shell: "docker logs {{ item }} &> {{ ansible_user_dir }}/zuul-output/logs/docker/{{ item }}.txt"
|
|
||||||
args:
|
|
||||||
executable: /bin/bash
|
|
||||||
|
Loading…
Reference in New Issue
Block a user