forked from rodrigopascoal/dt-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dt-onboarding-workflow-set-stats.yml
88 lines (88 loc) · 3.35 KB
/
dt-onboarding-workflow-set-stats.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Generate dynamic variables for onboarding workflow
# host_name -> target host to execute playbook
# application_name -> application name to be used for host_group, web application, management zone, alerting profile, notification, and dashboard
# application_url_pattern -> URL pattern for web application detection rule
# application_owner_email -> email address of application owner
---
-
hosts: "{{ host_name }}"
name: "Onboarding Workflow Set Stats"
tasks:
-
name: "generate web application detection rule uuid"
set_stats:
data:
dt_detection_rule_uuid: "{{ 9999999999999999999999 | random | to_uuid }}" # generates a random number and converts to UUID
when: dt_detection_rule_uuid is undefined
-
name: "generate management zone 64 bit integer id"
set_stats:
data:
dt_mz_64id: "{{ 999999999999999999 | random(100000000000000000, 10) }}" # Generate a random 64 bit integer
when: dt_mz_64id is undefined
-
name: "generate alerting profile uuid"
set_stats:
data:
dt_ap_uuid: "{{ 9999999999999999999999 | random | to_uuid }}" # generates a random number and converts to UUID
when: dt_ap_uuid is undefined
-
name: "generate problem notification uuid"
set_stats:
data:
dt_notification_uuid: '{{ 9999999999999999999999 | random | to_uuid }}' # generates a random number and converts to UUID
when: dt_notification_uuid is undefined
-
name: "generate dashboard uuid"
set_stats:
data:
dt_dashboard_uuid: '{{ 9999999999999999999999 | random | to_uuid }}' # generates a random number and converts to UUID
when: dt_dashboard_uuid is undefined
-
name: "set dynatrace host group"
set_stats:
data:
dt_host_group: "{{ application_name }}"
when: application_name is defined and dt_host_group is undefined
-
name: "set management zone name"
set_stats:
data:
dt_mz_name: "{{ application_name }}"
when: application_name is defined and dt_mz_name is undefined
-
name: "set web application name"
set_stats:
data:
dt_web_application_name: "{{ application_name }}"
when: application_name is defined and dt_web_application_name is undefined
-
name: "set dashboard name"
set_stats:
data:
dt_dashboard_name: "{{ application_name }} application overview"
when: application_name is defined and dt_dashboard_name is undefined
-
name: "set problem notification name"
set_stats:
data:
dt_notification_name: "{{ application_name }}"
when: application_name is defined and dt_notification_name is undefined
-
name: "set web application url pattern"
set_stats:
data:
dt_url_pattern: "{{ application_url_pattern }}"
when: application_url_pattern is defined and dt_url_pattern is undefined
-
name: "set notification email recipient"
set_stats:
data:
dt_email_receiver: "{{ application_owner_email }}"
when: application_owner_email is defined and dt_email_receiver is undefined
-
name: "set dashboard owner"
set_stats:
data:
dt_owner_id: "{{ application_owner_email }}"
when: application_owner_email is defined and dt_owner_id is undefined