kubekey/builtin/core/roles/copy/tasks/main.yaml
zuoxuesong-worker bd780ee397
feat: add export copy func (#2875)
feat: add export copy func



feat: add export copy func

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>
2025-11-28 15:58:00 +08:00

29 lines
808 B
YAML

---
- name: Copy | Set artifact file dir
when:
- .artifact_file | empty | not
set_fact:
artifact_file_dir: >-
{{ .artifact_file | dir }}/artifact
- name: Copy | Create artifact file dir
command: >-
mkdir -p {{ .artifact_file_dir }}/kubekey/kubekey/
- name: Artifact | Copy required binaries and images
when: .artifact_file_dir | empty | not
block:
# Download core binaries
- include_tasks: binary.yaml
# Download Helm and CNI binaries
- include_tasks: helm.yaml
tags: ["kubernetes"]
# Download remote images to the local images directory
- include_tasks: images.yaml
tags: ["kubernetes", "image_registry"]
- include_tasks: iso.yaml
- name: Export artifact
command: |
cd {{ .artifact_file_dir }} && tar -czvf {{ .artifact_file }} *