From 30ebb0fd17bcd7056fba169b4702ded98c40544f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C5=BEe=20=C5=BDitnik?= <anze.zitnik@xlab.si>
Date: Tue, 14 Dec 2021 12:05:39 +0100
Subject: [PATCH] Fix timeout-checking Ansible task for wazuh manager

---
 ansible/custom-integration/tasks/main.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ansible/custom-integration/tasks/main.yml b/ansible/custom-integration/tasks/main.yml
index 18f29b7..e8a0120 100644
--- a/ansible/custom-integration/tasks/main.yml
+++ b/ansible/custom-integration/tasks/main.yml
@@ -8,6 +8,7 @@
 - name: Check if timeout value is already inserted in systemctl service config
   shell: grep -q TimeoutStartSec /usr/lib/systemd/system/wazuh-manager.service
   register: grep_timeout
+  failed_when: grep_timeout.rc >= 2
 
 - name: Increase systemctl service startup timeout
   shell: sed -i 's/\\[Service\\]/\\[Service\\]\nTimeoutStartSec=300/' /usr/lib/systemd/system/wazuh-manager.service
-- 
GitLab