kubekey/builtin/core/playbooks/hook/pre_install.yaml
liujian 3885b443ac
fix: change builtin/core architectures (#2718)
Signed-off-by: redscholar <blacktiledhouse@gmail.com>
2025-08-22 21:59:40 +08:00

26 lines
775 B
YAML

---
- name: Pre | Run Pre-Installation Scripts
hosts:
- all
tasks:
- name: Pre | Copy pre-installation scripts to remote hosts
ignore_errors: true
copy:
src: >-
{{ .work_dir }}/scripts/pre_install_{{ .inventory_hostname }}.sh
dest: >-
/etc/kubekey/scripts/pre_install_{{ .inventory_hostname }}.sh
mode: 0755
register: pre_install_copy_result
- name: Pre | Execute pre-installation scripts on remote hosts
when: .pre_install_copy_result.error | empty
command: |
for file in /etc/kubekey/scripts/pre_install_*.sh; do
if [ -f "$file" ]; then
# Make the script executable and run it
chmod +x "$file"
"$file"
fi
done