Hi,
I have written the ansible playbook to check the url, but I need an email just with “OK” status if the response is 200.
Can you please help me with this?
Thanks.
Hi,
I have written the ansible playbook to check the url, but I need an email just with “OK” status if the response is 200.
Can you please help me with this?
Thanks.
Hi,
Thanks for the reply.
This is my playbook. Here I want to print just “OK” if the status code is 200.
tasks:
name: check the url http://{{ hosts }}:{{ port }}/test
uri: url: “http://{{ hosts }}:{{ port }}/test”
follow_redirects: none
method: GET
register: _result
until: _result.status == 200
name: Health check for url
mail:
host: ‘localhost’
port:25