2
0

added teams notification

This commit is contained in:
2024-06-08 14:23:25 +02:00
parent 4ca2cec4d4
commit 9c02e05ba0

View File

@@ -22,3 +22,17 @@
- name: Wait for systems to become reachable
wait_for_connection:
- name: Send Teams notification
uri:
url: "{{ Teams_webhook }}"
method: POST
body: |
{
"title": "Reboot Status",
"text": "Servers checked: {{ ansible_play_hosts_all | join(', ') }}{% if reboot.stat.exists %}. Rebooted: {{ ansible_play_hosts_all | join(', ') }}{% endif %}"
}
body_format: json
headers:
Content-Type: application/json
when: reboot.stat.exists or not reboot.stat.exists