system-config/playbooks/test-static.yaml
Ian Wienand e701fdd3ca Add a functional test for registry.zuul-ci.org
Change-Id: I1fa239275100b91db2fa67bfd3d60d7d27b6aaa0
2023-03-20 17:00:35 +00:00

33 lines
1007 B
YAML

- 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