ansible-uptime-kuma icon indicating copy to clipboard operation
ansible-uptime-kuma copied to clipboard

adding notification to monitor task

Open gabriel-blankenship opened this issue 1 year ago • 0 comments

Trying to figure out how to add a notification to a particular monitor task in ansible so that it can all be generated at the same time. Any ideas?

An example task I'm working on:

 - name: Add SSL check for all domain certificates
   lucasheld.uptime_kuma.monitor:
     api_url: "{{ kuma_api_url }}"
     api_token: "{{ api_token }}"
     name: "SSL Verify: {{ item }}"
     url: https://{{ item }}
     type: http
     expiryNotification: true
     state: present
     interval: 86400
   tags:
     - kuma_monitors

I want to create a slack notification via a webhook. Does the slack notification need to be created first and register the output to grab an id from it and then add that to the above task? Going to try and test via this documentation https://github.com/lucasheld/ansible-uptime-kuma/wiki/monitor_info with notificationIDList that currently is the only thing I'm seeing that might be the route I should be taking.

I plan to add a debug task after the notification task is ran to see if it gives me an id, if so then will add that to a task via the notificationIDList.

I also posted this question here sorry if this doesn't exactly fit here but wasn't sure where else I could post and get a response.

gabriel-blankenship avatar Nov 08 '23 08:11 gabriel-blankenship