zhong (钟鹏群) 1 개월 전
부모
커밋
a239cbf22b
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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: