zhong (钟鹏群) 1 tháng trước cách đây
mục cha
commit
a239cbf22b
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      cluster-setup/ansible-files/install-k3s-master.yml

+ 3 - 3
cluster-setup/ansible-files/install-k3s-master.yml

@@ -22,14 +22,14 @@
       ignore_errors: yes
 
     - name: Check for running k3s processes
-      shell: pgrep -f k3s
+      shell: pgrep -f k3s || true
       register: k3s_processes
-      failed_when: false
       changed_when: false
 
     - name: Kill running k3s processes if any exist
       shell: pkill -f k3s
-      when: k3s_processes.rc == 0  # Only run if processes were found
+      when: k3s_processes.stdout != ""
+      ignore_errors: yes
 
     - name: Remove k3s service file
       file: