adjusted the notification screen
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user