added teams notification
This commit is contained in:
@@ -22,3 +22,17 @@
|
|||||||
|
|
||||||
- name: Wait for systems to become reachable
|
- name: Wait for systems to become reachable
|
||||||
wait_for_connection:
|
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
|
||||||
Reference in New Issue
Block a user