From c58e2a51dcd733277b715943c6740d3fe6fc877c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 18 Feb 2019 10:29:05 -0800 Subject: [PATCH] Load buildset_registry in intermediate pull The intermediate registry pull role is designed to be used in the same playbook as the run-buildset-registry role, which sets the buildset_registry fact. However, that fact is set on the host where the registry runs, not localhost. Theoretically we should be able to delegate setting that fact to all hosts in the inventory, plus localhost, however, that doesn't seem to work in local testing. Work around this by, once again, loading the buildset_registry fact from the zuul_return file. Change-Id: Ia16b3af8782c875e64ad5eeeeb5f107482a3e30a --- roles/pull-from-intermediate-registry/tasks/main.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/pull-from-intermediate-registry/tasks/main.yaml b/roles/pull-from-intermediate-registry/tasks/main.yaml index dabe36767..b787eb9e0 100644 --- a/roles/pull-from-intermediate-registry/tasks/main.yaml +++ b/roles/pull-from-intermediate-registry/tasks/main.yaml @@ -1,3 +1,12 @@ +# This can be removed if we add this functionality to Zuul directly +- name: Load information from zuul_return + when: buildset_registry is not defined + set_fact: + buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}" +- name: Ensure registry cert directory exists + file: + path: "/etc/docker/certs.d/{{ buildset_registry.host }}:{{ buildset_registry.port }}/" + state: directory - name: Ensure registry cert directory exists file: path: "/etc/docker/certs.d/{{ buildset_registry.host }}:{{ buildset_registry.port }}/"