forked from popecruzdt/dt-ansible-autoremediation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initiate-change-html.yml
41 lines (41 loc) · 1.33 KB
/
initiate-change-html.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
# initiate change
---
-
hosts: all
name: "initiate change with Ansible"
tasks:
-
name: "perform a change with Ansible task(s)"
copy:
content: 'The application is broken'
dest: /var/www/html/index.html
-
name: "send Dynatrace custom configuration event with business context information"
uri:
url: https://{{ dynatrace_api_url }}/api/v1/events?Api-Token={{ dynatrace_token }}
method: POST
headers:
content-type: application/json
body:
eventType: CUSTOM_CONFIGURATION
attachRules:
tagRule:
- meTypes:
- SERVICE
- PROCESS_GROUP_INSTANCE
- HOST
- HTTP_CHECK
tags:
- context: CONTEXTLESS
key: "{{ configuration_tag_key }}"
value: "{{ configuration_tag_value }}"
source: Ansible Tower
description: "{{ configuration_details }}"
configuration: "{{ configuration_type }}"
customProperties:
Change Ticket: "{{ configuration_change_ticket }}"
Change New: "{{ configuration_new }}"
Change Old: "{{ configuration_old }}"
Remediation: "{{ configuration_remediation }}"
body_format: json
status_code: 200