Push images to registry
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-07-01 10:32:58 +02:00
parent d5c886f02b
commit b2ceee8720

View File

@ -55,11 +55,6 @@
chdir: /opt/metacluster/container-images
loop: "{{ imagetarballs.files }}"
# - name: Delete redundant files
# ansible.builtin.file:
# path: /opt/metacluster/container-images
# state: absent
- name: Install longhorn chart
kubernetes.core.helm:
name: longhorn
@ -96,6 +91,34 @@
notary:
enabled: false
- name: Push images to registry
ansible.builtin.shell:
cmd: |>
skopeo copy \
--dest-tls-verify=false \
--dest-creds admin:{{ vapp['guestinfo.rootpw'] }} \
docker-archive:./{{ item }} \
docker://registry.{{ vapp['guestinfo.fqdn'] }}/library/$( \
k3s ctr run \
--rm \
--mount type=bind,src=$PWD,dst=/data,options=rbind:ro \
quay.io/skopeo/stable:v1.8.0 \
skopeo-{{ lookup('community.general.random_string', length=5) }} \
skopeo list-tags /data/{{ item }} | \
jq -r '.Tags[0]')
chdir: /opt/metacluster/container-images/
register: results
ignore_errors: yes
loop: "{{ imagetarballs.files }}"
- ansible.builtin.debug:
var: results
#- name: Delete container image tarballs/archives
# ansible.builtin.file:
# path: /opt/metacluster/container-images
# state: absent
- name: Cleanup tempfile
ansible.builtin.file:
path: "{{ kubeconfig.path }}"