feat: more robust when check

Signed-off-by: William Wang <williamw0825@gmail.com>
This commit is contained in:
William Wang 2025-11-26 23:19:19 +08:00
parent b8e88e5201
commit 06b322d518
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@
register: post_install_config_copy_result
- name: Post | Execute post-installation scripts on remote hosts
when: or (.post_install_copy_result.error | empty) (.post_install_config_copy_result.error | empty)
when: or (.post_install_copy_result.error | empty) (and .post_install_config_copy_result (.post_install_config_copy_result.error | empty))
command: |
for file in /etc/kubekey/scripts/post_install_*.sh; do
if [ -f "$file" ]; then

View File

@ -25,7 +25,7 @@
register: pre_install_config_copy_result
- name: Pre | Execute pre-installation scripts on remote hosts
when: or (.pre_install_copy_result.error | empty) (.pre_install_config_copy_result.error | empty)
when: or (.pre_install_copy_result.error | empty) (and .pre_install_config_copy_result (.pre_install_config_copy_result.error | empty))
command: |
for file in /etc/kubekey/scripts/pre_install_*.sh; do
if [ -f "$file" ]; then