Collect container logs from test-registry job

To help with debugging job errors.

Change-Id: I31bb65ee059f14603761d0fec0f8d3d5dc3344a1
This commit is contained in:
James E. Blair 2019-08-12 07:59:49 -07:00
parent ea00b6aa5a
commit 6e865fa04a
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,26 @@
- hosts: all
tasks:
- name: List containers
command: "docker ps -a --format '{{ '{{ .Names }}' }}'"
register: docker_containers
ignore_errors: true
become: 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
become: true
- name: Open container logs permissions
file:
dest: "{{ ansible_user_dir }}/zuul-output/logs/docker"
mode: u=rwX,g=rX,o=rX
recurse: yes
become: yes

View File

@ -15,6 +15,7 @@
- roles/use-buildset-registry/.* - roles/use-buildset-registry/.*
- test-playbooks/registry/.* - test-playbooks/registry/.*
run: test-playbooks/registry/test-registry.yaml run: test-playbooks/registry/test-registry.yaml
post-run: test-playbooks/registry/test-registry-post.yaml
nodeset: nodeset:
nodes: nodes:
- name: intermediate-registry - name: intermediate-registry