kubekey/builtin/core/playbooks/hook/post_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

32 lines
907 B
YAML

---
- name: Post | Apply Security Enhancements
hosts:
- all
roles:
- role: security
when: .security_enhancement
- name: Post | Run Post-Installation Scripts
hosts:
- all
tasks:
- name: Post | Copy post-installation scripts to remote hosts
ignore_errors: true
copy:
src: >-
{{ .scripts_dir }}/post_install_{{ .inventory_hostname }}.sh
dest: >-
/etc/kubekey/scripts/post_install_{{ .inventory_hostname }}.sh
mode: 0755
register: post_install_copy_result
- name: Post | Execute post-installation scripts on remote hosts
when: .post_install_copy_result.error | empty
command: |
for file in /etc/kubekey/scripts/post_install_*.sh; do
if [ -f "$file" ]; then
# Make the script executable and run it
chmod +x "$file"
"$file"
fi
done