--- # Import local Docker image tarballs directly into k3s containerd on all nodes. # # Usage: # ansible-playbook k3s_import_images.yml \ # -e '{"k3s_import_image_tars": ["/path/to/image1.tar", "/path/to/image2.tar"]}' # # This avoids the slow docker-push-to-registry flow by copying tarballs # directly to each k3s node and importing via `k3s ctr images import`. - name: Import container images into k3s nodes hosts: k3s_hosts gather_facts: false become: true serial: 1 pre_tasks: - name: Gather minimal facts ansible.builtin.setup: gather_subset: - min - name: Skip import on hosts where k3s is disabled ansible.builtin.meta: end_host when: not (k3s_enabled | default(true) | bool) tasks: - name: Import image tarballs ansible.builtin.import_role: name: k3s tasks_from: import_images when: (k3s_import_images | default([])) | length > 0