From c2c6a2872f70017a73ce4903cbdfd7442ddd9cc9 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 12 Apr 2023 23:11:26 +0200 Subject: [PATCH] Fix conditional for changed after install --- kubernetes/tasks/install/agent/install_k3s.yml | 2 +- kubernetes/tasks/install/server/install_k3s.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kubernetes/tasks/install/agent/install_k3s.yml b/kubernetes/tasks/install/agent/install_k3s.yml index 94a064a..87bd64b 100644 --- a/kubernetes/tasks/install/agent/install_k3s.yml +++ b/kubernetes/tasks/install/agent/install_k3s.yml @@ -1,7 +1,7 @@ - name: Install K3s agent command: /root/k3s_install.sh {{ type }} register: command - changed_when: "'No change detected' in command.stdout" + changed_when: "'No change detected' not in command.stdout" until: "command is not failed" retries: 2 delay: 10 diff --git a/kubernetes/tasks/install/server/install_k3s.yml b/kubernetes/tasks/install/server/install_k3s.yml index b4a3076..620b5f9 100644 --- a/kubernetes/tasks/install/server/install_k3s.yml +++ b/kubernetes/tasks/install/server/install_k3s.yml @@ -2,7 +2,7 @@ command: /root/k3s_install.sh {{ type }} when: "inventory_hostname == groups['kubernetes'][0]" register: command - changed_when: "'No change detected' in command.stdout" + changed_when: "'No change detected' not in command.stdout" - name: Restart when config changed, but install already done service: @@ -21,7 +21,7 @@ command: /root/k3s_install.sh {{ type }} when: "inventory_hostname != groups['kubernetes'][0]" register: command - changed_when: "'No change detected' in command.stdout" + changed_when: "'No change detected' not in command.stdout" until: "command is not failed" retries: 2 delay: 10