2
0

adjusted the notification screen

This commit is contained in:
2024-06-08 14:37:11 +02:00
parent 9c02e05ba0
commit dab834ff4c

View File

@@ -24,13 +24,22 @@
wait_for_connection: wait_for_connection:
- name: Send Teams notification - name: Send Teams notification
run_once: true
uri: uri:
url: "{{ Teams_webhook }}" url: "{{ Teams_webhook }}"
method: POST method: POST
body: | body: |
{ {
"title": "Reboot Status", "title": "Playbook: {{ playbook_name }}",
"text": "Servers checked: {{ ansible_play_hosts_all | join(', ') }}{% if reboot.stat.exists %}. Rebooted: {{ ansible_play_hosts_all | join(', ') }}{% endif %}" "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 body_format: json
headers: headers: