-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo-simplenodeservice-initiate-deployment.yml
43 lines (43 loc) · 1.42 KB
/
demo-simplenodeservice-initiate-deployment.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
# initiate deployment for simplenodeservice
---
-
hosts: "{{ demo_host }}"
name: "initiate deployment with Ansible"
tasks:
-
name: "deploy - remove existing simplenodeservice container"
shell: "docker kill simplenodeservice"
become: true
-
name: "deploy - run new simplenodeservice container"
shell: "docker run -d -p 8080:8080 --rm --name simplenodeservice grabnerandi/simplenodeservice:2.0.2"
become: true
-
name: "push Dynatrace custom deployment event"
uri:
url: "{{ dt_api_url }}/v1/events"
method: POST
headers:
content-type: application/json
Authorization: "Api-Token {{ dt_api_token }}"
body:
eventType: CUSTOM_DEPLOYMENT
attachRules:
tagRule:
- meTypes:
- SERVICE
- PROCESS_GROUP_INSTANCE
- HOST
tags:
- context: CONTEXTLESS
key: "{{ deployment_tag_key }}"
value: "{{ deployment_tag_value }}"
source: "Ansible Automation Platform"
deploymentName: "SimpleNodeService"
deploymentVersion: "2.0.2"
remediationAction: "{{ deployment_remediation }}"
customProperties:
Details: "SimpleNodeService Deploy New Version"
Version: "grabnerandi/simplenodeservice:2.0.2"
body_format: json
status_code: 200