2026-04-22 11:00:54 +00:00
|
|
|
---
|
2026-05-02 00:41:25 +00:00
|
|
|
- name: Pull Rancher images into containerd
|
2026-04-24 11:44:11 +00:00
|
|
|
shell: |
|
2026-05-03 01:50:22 +00:00
|
|
|
if /usr/local/bin/k3s crictl inspecti "{{ item }}" >/dev/null 2>&1; then
|
2026-04-24 11:44:11 +00:00
|
|
|
echo "already present"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-02 02:42:58 +00:00
|
|
|
echo "mtu=$(cat /sys/class/net/{{ ansible_default_ipv4.interface | default('eth0') }}/mtu 2>/dev/null || true)"
|
|
|
|
|
ip route get 1.1.1.1 || true
|
|
|
|
|
|
|
|
|
|
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
|
|
|
|
echo "pull attempt ${attempt}: {{ item }}"
|
2026-05-03 01:50:22 +00:00
|
|
|
if timeout 240s /usr/local/bin/k3s crictl pull "{{ item }}"; then
|
2026-04-24 11:44:11 +00:00
|
|
|
echo "pulled image"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-02 02:42:58 +00:00
|
|
|
sleep 15
|
2026-04-24 11:44:11 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
args:
|
|
|
|
|
executable: /bin/bash
|
2026-04-22 11:00:54 +00:00
|
|
|
register: rancher_image_pull
|
|
|
|
|
loop: "{{ rancher_images_to_prepull }}"
|
2026-05-02 00:41:25 +00:00
|
|
|
changed_when: "'pulled image' in rancher_image_pull.stdout"
|