-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdt-ansible-email-notification.yml
25 lines (25 loc) · 1.09 KB
/
dt-ansible-email-notification.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# send email with dynatrace onboarding summary
# host_name -> target host to execute playbook
# smtp_host -> mail server smtp hosts
# smtp_port -> mail server smtp smtp
# smtp_username -> mail server username
# smtp_password -> mail server password
# dt_email_receiver -> email recipient address
# dt_host_group -> dynatrace host group name
# dt_base_url -> dynatrace environment/tenant base url
# dt_dashboard_uuid -> unique UUID id of dynatrace dashboard
---
-
hosts: "{{ host_name }}"
name: "send email with dynatrace onboarding success and dashboard link"
tasks:
- name: send email with dashboard link
mail:
host: "{{ smtp_host }}"
port: "{{ smtp_port }}"
username: "{{ smtp_username }}"
password: "{{ smtp_password }}"
to: "{{ dt_email_receiver }}"
from: "{{ dt_email_receiver }}"
subject: "Ansible Tower Dynatrace Onboarding of {{ dt_host_group }}"
body: "Application {{ dt_host_group }} has been successfully onboarded. View your application dashboard using this URL: {{ dt_base_url }}#dashboard;id={{ dt_dashboard_uuid }};"