From f4f234e1a9f5d68eeea8141b0b789da31a2faebe Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Thu, 9 Jan 2020 19:42:16 -0500 Subject: [PATCH] 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 --- .../post.yaml | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/playbooks/nodepool-functional-container-openstack/post.yaml b/playbooks/nodepool-functional-container-openstack/post.yaml index 8d972efaf..441449d07 100644 --- a/playbooks/nodepool-functional-container-openstack/post.yaml +++ b/playbooks/nodepool-functional-container-openstack/post.yaml @@ -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 \ No newline at end of file + mode: pull