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
This commit is contained in:
James E. Blair 2019-02-18 10:29:05 -08:00
parent 71b7cb0ae5
commit c58e2a51dc
1 changed files with 9 additions and 0 deletions

View File

@ -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 }}/"