diff --git a/playbooks/roles/static/files/50-registry.zuul-ci.org.conf b/playbooks/roles/static/files/50-registry.zuul-ci.org.conf index cec29eeb25..f38ea3c275 100644 --- a/playbooks/roles/static/files/50-registry.zuul-ci.org.conf +++ b/playbooks/roles/static/files/50-registry.zuul-ci.org.conf @@ -34,7 +34,8 @@ AllowOverride None - RewriteRule ^/v2/(.*)$ https://quay.io/v2/corvus/$1 [R=302,L] + RewriteRule ^/v1/(.*)$ https://quay.io/v1/$1 [R=302,L] + RewriteRule ^/v2/(.+)$ https://quay.io/v2/corvus/$1 [R=302,L] ErrorLog /var/log/apache2/registry.zuul-ci.org_error.log LogLevel warn diff --git a/playbooks/test-static.yaml b/playbooks/test-static.yaml new file mode 100644 index 0000000000..de2a827251 --- /dev/null +++ b/playbooks/test-static.yaml @@ -0,0 +1,32 @@ +- hosts: "prod_bastion[0]" + tasks: + + # Do a test pull through the HTTP redirect registry site running + # on the static host. + + - name: Add registry redirect hosts + lineinfile: + dest: /etc/hosts + regexp: '.*{{ item.registry }}$' + line: '{{ hostvars[item.host].ansible_host }} {{ item.registry }}' + state: present + loop: + - { 'host' : 'static99.opendev.org', + 'registry': 'registry.zuul-ci.org' } + + - name: Do a test docker pull through redirect + command: docker pull registry.zuul-ci.org/zuul:8.2.0 + register: _docker_pull + + - name: Check output + assert: + that: '"Digest: sha256:4a54086c286a7f12434d3d0fb620081c5d967c5fe335229a239155913662f4a1" in _docker_pull.stdout' + + - name: Install podman + package: + name: podman + state: present + + - name: Do a test podman pull through redirect + command: podman --log-level=debug pull registry.zuul-ci.org/zuul:8.2.0 + register: _podman_pull diff --git a/zuul.d/system-config-run.yaml b/zuul.d/system-config-run.yaml index 40ea4bb269..5f6467a649 100644 --- a/zuul.d/system-config-run.yaml +++ b/zuul.d/system-config-run.yaml @@ -1157,12 +1157,14 @@ run_playbooks: - playbooks/letsencrypt.yaml - playbooks/service-static.yaml + run_test_playbook: playbooks/test-static.yaml files: - playbooks/bootstrap-bridge.yaml - playbooks/roles/static/ - playbooks/roles/letsencrypt - playbooks/letsencrypt.yaml - playbooks/service-static.yaml + - playbooks/test-static.yaml - testinfra/test_static.py host-vars: static99.opendev.org: