From 515d9b52092ac7656173e1b2a68e3bcd017a0ba1 Mon Sep 17 00:00:00 2001 From: Abhinav Kalra Date: Wed, 14 Aug 2024 10:26:24 +0000 Subject: [PATCH] fix beats checking handler --- handlers/main.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 760644f..c5368cf 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -89,15 +89,18 @@ listen: beats-restart-service - name: "{{ beats_flavor }}: Check that beats service has started successfully" - docker_container_info: - name: "{{ beats_flavor }}" - register: container_info - until: container_info.exists and container_info.container.State.Running + uri: + url: "http://{{ beats_config.http.host }}:{{ beats_config.http.port }}" + return_content: true + validate_certs: true + register: result + until: result is success and result.status == 200 retries: 60 delay: 20 + failed_when: + - result is failed + - result.status != 200 listen: beats-restart-service - failed_when: not container_info.exists - when: - beats_enable_service | bool - ansible_os_family != 'Windows'