diff --git a/Maintenance/maint-reboot-required.yaml b/Maintenance/maint-reboot-required.yaml index 88519ca..ba1a2e5 100644 --- a/Maintenance/maint-reboot-required.yaml +++ b/Maintenance/maint-reboot-required.yaml @@ -24,13 +24,22 @@ wait_for_connection: - name: Send Teams notification + run_once: true 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 %}" + "title": "Playbook: {{ playbook_name }}", + "text": "All servers were checked and rebooted where needed.", + "facts": [ + {% for host in ansible_play_hosts_all %} + { + "name": "{{ host }}", + "value": "{% if host in reboot_results | select('stat.exists') | map('ansible_host') %}&#U+2705 Rebooted{% else %}Not Rebooted{% endif %}" + }{% if not loop.last %},{% endif %} + {% endfor %} + ] } body_format: json headers: