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: I1b1bdad108515604dce45c7b418bfaae1bf235a8
This commit is contained in:
parent
b791b4932c
commit
f4f234e1a9
@ -1,4 +1,6 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- collect-container-logs
|
||||
tasks:
|
||||
- name: Copy nodepool log files
|
||||
synchronize:
|
||||
@ -40,25 +42,9 @@
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
|
||||
- name: List containers
|
||||
command: "docker ps -a --format '{{ '{{ .Names }}' }}'"
|
||||
register: docker_containers
|
||||
ignore_errors: true
|
||||
|
||||
- name: Create container log dir
|
||||
file:
|
||||
path: "{{ ansible_user_dir }}/docker"
|
||||
state: directory
|
||||
|
||||
- name: Save container logs
|
||||
loop: "{{ docker_containers.stdout_lines | default([]) }}"
|
||||
shell: "docker logs {{ item }} &> {{ ansible_user_dir }}/docker/{{ item }}.txt"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Copy docker logs
|
||||
become: True
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/docker'
|
||||
src: '{{ ansible_user_dir }}/zuul-output/logs/docker'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
mode: pull
|
||||
|
Loading…
x
Reference in New Issue
Block a user