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
This commit is contained in:
James E. Blair 2019-03-09 07:52:54 -08:00 committed by Clark Boylan
parent adc851b377
commit f775087476

View File

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