Merge "Switch to collect-container-logs"

This commit is contained in:
Zuul 2020-01-17 00:03:39 +00:00 committed by Gerrit Code Review
commit b6f3f38479

View File

@ -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