Skip to content

Commit

Permalink
fix beats checking handler
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi8080 committed Aug 14, 2024
1 parent 7b50851 commit 515d9b5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 515d9b5

Please sign in to comment.