-
Notifications
You must be signed in to change notification settings - Fork 8
/
ansible-rollback-deployment.yml
41 lines (41 loc) · 1.39 KB
/
ansible-rollback-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
# rollback deployment
---
-
hosts: localhost
name: "rollback deployment with Ansible"
tasks:
-
name: "rollback a deployment with Ansible task(s)"
uri:
url: "replace this module with the module of your choice to rollback the deployment"
-
name: "push Dynatrace custom deployment event"
uri:
url: https://{{ dynatrace_api_url }}/api/v1/events?Api-Token={{ dynatrace_token }}
method: POST
headers:
content-type: application/json
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 Tower
deploymentName: "{{ deployment_name }}"
deploymentVersion: "{{ deployment_version}}"
remediationAction: "{{ deployment_remediation }}"
customProperties:
Change Ticket: "{{ deployment_change_ticket }}"
Details: "{{ deployment_details }}"
Feature Flag: "{{ deployment_feature }}"
FF Previous State: "{{ deployment_p_state }}"
FF Current State: "{{ deployment_c_state }}"
body_format: json
status_code: 200