zuul-jobs/roles/use-buildset-registry/tasks/microk8s-mirror.yaml
Ian Wienand 65aa2bdc1f use-buildset-registry: support microk8s
This enables microk8s/containerd to pull through the intermediate zuul
registry.  This is tested with the new
zuul-jobs-test-registry-buildset-registry-k8s-microk8s job.

Change-Id: I5a6c0d63a6ba0acf94ab9f0ef94777fab58fec6e
2023-01-09 10:37:45 -08:00

29 lines
990 B
YAML

- name: Make config dir
file:
path: /var/snap/microk8s/current/args/certs.d/{{ zj_uk8s_mirror[0] }}
state: directory
owner: 'root'
group: 'root'
mode: 0755
# NOTE(ianw) : I'm not 100% if microk8s can globally reference this
# because of it's snap bundling. Copy it and reference directly
- name: Copy buildset registry CA
copy:
src: '{{ ca_dir }}/{{ buildset_registry_alias }}.crt'
dest: '/var/snap/microk8s/current/args/certs.d/{{ zj_uk8s_mirror[0] }}/ca.crt'
remote_src: true
- name: Write content
copy:
dest: '/var/snap/microk8s/current/args/certs.d/{{ zj_uk8s_mirror[0] }}/hosts.toml'
content: |
server = "{{ zj_uk8s_mirror[1] }}"
[host."{{ buildset_registry_alias }}:{{ buildset_registry.port }}/v2/{{ zj_uk8s_mirror [0]}}"]
capabilities = ["pull", "resolve"]
ca = "/var/snap/microk8s/current/args/certs.d/{{ zj_uk8s_mirror[0] }}/ca.crt"
override_path = true
owner: root
group: root
mode: 0644