Browse Source

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
changes/03/637603/1
James E. Blair 3 months ago
parent
commit
c58e2a51dc
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      roles/pull-from-intermediate-registry/tasks/main.yaml

+ 9
- 0
roles/pull-from-intermediate-registry/tasks/main.yaml View File

@@ -1,3 +1,12 @@
1
+# This can be removed if we add this functionality to Zuul directly
2
+- name: Load information from zuul_return
3
+  when: buildset_registry is not defined
4
+  set_fact:
5
+    buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}"
6
+- name: Ensure registry cert directory exists
7
+  file:
8
+    path: "/etc/docker/certs.d/{{ buildset_registry.host }}:{{ buildset_registry.port }}/"
9
+    state: directory
1 10
 - name: Ensure registry cert directory exists
2 11
   file:
3 12
     path: "/etc/docker/certs.d/{{ buildset_registry.host }}:{{ buildset_registry.port }}/"

Loading…
Cancel
Save