Files
HetznerTerra/ansible/roles/rancher-image-prepull/tasks/main.yml
T

21 lines
736 B
YAML
Raw Normal View History

---
- name: Pre-pull Rancher images into containerd
command: timeout 180s /usr/local/bin/ctr -n k8s.io images pull {{ item }}
register: rancher_image_pull
loop: "{{ rancher_images_to_prepull }}"
retries: 6
delay: 20
until: rancher_image_pull.rc == 0
changed_when: rancher_image_pull.rc == 0
failed_when: false
- name: Report Rancher images that did not pre-pull after retries
debug:
msg: >-
Best-effort Rancher image pre-pull did not complete for {{ item.item }} after
{{ item.attempts | default(1) }} attempt(s): {{ item.stderr | default('no stderr') }}
loop: "{{ rancher_image_pull.results | default([]) }}"
loop_control:
label: "{{ item.item }}"
when: item.rc is defined and item.rc != 0