mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
26 lines
775 B
YAML
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
|