--- - 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