Switch to building with Depot

Change-Id: I4547e671e11f76e6776192cc68040d5e2ff61be9
(cherry picked from commit 564caa8bd7f1cf771958a97b8fff7c9bef90e447)
diff --git a/zuul.d/playbooks/build-collection/pre.yml b/zuul.d/playbooks/build-collection/pre.yml
index 450407b..7319377 100644
--- a/zuul.d/playbooks/build-collection/pre.yml
+++ b/zuul.d/playbooks/build-collection/pre.yml
@@ -16,7 +16,7 @@
   ansible.builtin.import_playbook: ../common/generate-changelog.yml
 
 - name: Configure Buildset Registry
-  ansible.builtin.import_playbook: ../common/configure-buildset-registry.yml
+  ansible.builtin.import_playbook: ../common/configure-ci-registry.yml
 
 - name: Prepare for collection build
   hosts: all
diff --git a/zuul.d/playbooks/common/configure-buildset-registry.yml b/zuul.d/playbooks/common/configure-buildset-registry.yml
deleted file mode 100644
index 7ab8e75..0000000
--- a/zuul.d/playbooks/common/configure-buildset-registry.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-
-- name: Configure Buildset Registry
-  hosts: all
-  tasks:
-    # NOTE(mnaser): This can be removed once the following merges
-    #               https://review.opendev.org/c/zuul/zuul-jobs/+/915025
-    - name: Load "buildset_registry" fact
-      block:
-        - name: Check for results.json
-          stat:
-            path: "{{ zuul.executor.result_data_file }}"
-          register: result_json_stat
-          delegate_to: localhost
-        - name: Load information from zuul_return
-          no_log: true
-          set_fact:
-            buildset_registry: "{{ (lookup('file', zuul.executor.result_data_file) | from_json)['secret_data']['buildset_registry'] }}"
-          when:
-            - buildset_registry is not defined
-            - result_json_stat.stat.exists
-            - result_json_stat.stat.size > 0
-            - "'buildset_registry' in (lookup('file', zuul.executor.result_data_file) | from_json).get('secret_data')"
-
-    - name: Configure buildset registry
-      when: buildset_registry is defined
-      block:
-        - name: Install CA certificate for the registry
-          become: true
-          ansible.builtin.copy:
-            content: "{{ buildset_registry.cert }}"
-            dest: /usr/local/share/ca-certificates/registry.crt
-        - name: Update CA certificates
-          become: true
-          ansible.builtin.shell: update-ca-certificates
-        - name: Replace the registry in image manifest
-          ansible.builtin.replace:
-            path: "{{ zuul.project.src_dir }}/roles/defaults/vars/main.yml"
-            regexp: "{{ repo }}:"
-            replace: '{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ repo }}:'
-          loop: "{{ zuul.artifacts | default([]) }}"
-          loop_control:
-            loop_var: zj_zuul_artifact
-          when: "'metadata' in zj_zuul_artifact and zj_zuul_artifact.metadata.type | default('') == 'container_image'"
-          vars:
-            repo: "{{ zj_zuul_artifact.metadata.repository }}"
-        - name: Print out the new image manifest file
-          ansible.builtin.command: |
-            cat {{ zuul.project.src_dir }}/roles/defaults/vars/main.yml
diff --git a/zuul.d/playbooks/common/configure-ci-registry.yml b/zuul.d/playbooks/common/configure-ci-registry.yml
new file mode 100644
index 0000000..57684a1
--- /dev/null
+++ b/zuul.d/playbooks/common/configure-ci-registry.yml
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+- name: Configure CI registry
+  hosts: all
+  tasks:
+    - name: Replace the registry in image manifest
+      ansible.builtin.replace:
+        path: "{{ zuul.project.src_dir }}/roles/defaults/vars/main.yml"
+        regexp: "{{ zj_zuul_artifact.metadata.repository | regex_replace('/ci/', '/library/', 1) }}:.*"
+        replace: '{{ zj_zuul_artifact.metadata.repository }}:{{ zj_zuul_artifact.metadata.tag }}"'
+      loop: "{{ zuul.artifacts | default([]) }}"
+      loop_control:
+        loop_var: zj_zuul_artifact
+      when:
+        - "'metadata' in zj_zuul_artifact"
+        - "zj_zuul_artifact.metadata.type | default('') == 'container_image'"
+
+    - name: Print out the new image manifest file
+      ansible.builtin.command: |
+        cat {{ zuul.project.src_dir }}/roles/defaults/vars/main.yml
diff --git a/zuul.d/playbooks/molecule/pre.yml b/zuul.d/playbooks/molecule/pre.yml
index 932838e..4d9dfed 100644
--- a/zuul.d/playbooks/molecule/pre.yml
+++ b/zuul.d/playbooks/molecule/pre.yml
@@ -44,4 +44,4 @@
         chdir: "{{ zuul.project.src_dir }}"
 
 - name: Configure Buildset Registry
-  ansible.builtin.import_playbook: ../common/configure-buildset-registry.yml
+  ansible.builtin.import_playbook: ../common/configure-ci-registry.yml