diff --git a/roles/gather-host-logs/tasks/main.yaml b/roles/gather-host-logs/tasks/main.yaml index 5b04a446b..8031f9d68 100644 --- a/roles/gather-host-logs/tasks/main.yaml +++ b/roles/gather-host-logs/tasks/main.yaml @@ -29,6 +29,13 @@ brctl show > {{ logs_dir }}/system/brctl-show.txt ps aux --sort=-%mem > {{ logs_dir }}/system/ps.txt dpkg -l > {{ logs_dir }}/system/packages.txt + CONTAINERS=($(docker ps -a --format {% raw %}'{{ .Names }}'{% endraw %} --filter label=zuul)) + if [ ! -z "$CONTAINERS" ]; then + mkdir -p "{{ logs_dir }}/system/containers" + for CONTAINER in ${CONTAINERS}; do + docker logs "${CONTAINER}" > "{{ logs_dir }}/system/containers/${CONTAINER}.txt" + done + fi args: executable: /bin/bash ignore_errors: True diff --git a/roles/gather-pod-logs/tasks/main.yaml b/roles/gather-pod-logs/tasks/main.yaml index 373f5a0a5..d3a3a794c 100644 --- a/roles/gather-pod-logs/tasks/main.yaml +++ b/roles/gather-pod-logs/tasks/main.yaml @@ -21,7 +21,7 @@ path: "{{ logs_dir }}/pod-logs/failed-pods" state: directory -- name: "retrieve all container logs, current and previous (if they exist)" +- name: "retrieve all kubernetes logs, current and previous (if they exist)" shell: |- set -e PARALLELISM_FACTOR=2