Skip to content

Commit c4a4847

Browse files
committed
reduced disk footprint of container pe-pulls
1 parent 603e818 commit c4a4847

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- name: "Pull {{ item.name }} image with podman"
2+
containers.podman.podman_image:
3+
name: "{{ item.name }}"
4+
tag: "{{ item.tag }}"
5+
6+
- name: "Export {{ item.name }} image to k3s"
7+
containers.podman.podman_save:
8+
image: "{{ item.name }}:{{ item.tag }}"
9+
dest: "/var/lib/rancher/k3s/agent/images/{{ item.name | regex_replace('\\/|\\.','-')}}.tar"
10+
11+
- name: "Clean up {{ item.name }} podman image"
12+
containers.podman.podman_image:
13+
state: absent
14+
name: "{{ item.name }}"
15+
tag: "{{ item.tag }}"
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
---
22

33
- name: Pre-pull kube-prometheus-stack images and import to k3s
4-
block:
5-
- name: Pull with images with podman
6-
containers.podman.podman_image:
7-
name: "{{ item.name }}"
8-
tag: "{{ item.tag }}"
9-
loop: "{{ image_list }}"
10-
11-
- name: Export images to k3s
12-
containers.podman.podman_save:
13-
image: "{{ item.name }}:{{ item.tag }}"
14-
dest: "/var/lib/rancher/k3s/agent/images/{{ item.name | regex_replace('\\/|\\.','-')}}.tar"
15-
loop: "{{ image_list }}"
16-
17-
- name: Clean up podman images
18-
containers.podman.podman_image:
19-
state: absent
20-
name: "{{ item.name }}"
21-
tag: "{{ item.tag }}"
22-
loop: "{{ image_list }}"
4+
ansible.builtin.include_tasks: roles/kube_prometheus_stack/files/podman_to_k3s.yml
5+
loop: "{{ image_list }}"

0 commit comments

Comments
 (0)