diff --git a/Maintenance/maint-reboot-required.yaml b/Maintenance/maint-reboot-required.yaml index 93e47e0..88519ca 100644 --- a/Maintenance/maint-reboot-required.yaml +++ b/Maintenance/maint-reboot-required.yaml @@ -21,4 +21,18 @@ when: reboot.stat.exists - name: Wait for systems to become reachable - wait_for_connection: \ No newline at end of file + 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 \ No newline at end of file