From f7750874769546c9ed5d0e19b900ea1ca23a8389 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 9 Mar 2019 07:52:54 -0800 Subject: [PATCH] Don't save registry logs if registry isn't running Now that we use the buildset-registry job in all docker builds (whether they run the registry internally or not), in the post playbook we need to check whether the registry was actually started in the pre playbook before we attempt to save its logs. Change-Id: Ifa925faf7bfdc83238677261726aa96461faddb0 --- playbooks/buildset-registry/post.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/playbooks/buildset-registry/post.yaml b/playbooks/buildset-registry/post.yaml index e00065c..21272ff 100644 --- a/playbooks/buildset-registry/post.yaml +++ b/playbooks/buildset-registry/post.yaml @@ -4,12 +4,18 @@ - hosts: all tasks: + - name: Check if buildset registry is running + command: "docker ps" + register: docker_ps + - name: Create container log dir + when: "'buildset_registry' in docker_ps.stdout" file: path: "{{ ansible_user_dir }}/zuul-output/logs/docker" state: directory - name: Save registry container logs + when: "'buildset_registry' in docker_ps.stdout" loop: - buildset_proxy - buildset_registry