-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsnow_keepalive.yml
41 lines (37 loc) · 1.04 KB
/
snow_keepalive.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
---
- name: RAISE AN INCIDENT
hosts: localhost
connection: local
gather_facts: no
vars_files:
- default_vars.yml
- servicenow-credentials.yml
tasks:
- name: CREATE AN INCIDENT
snow_record:
username: "{{ SN_USERNAME }}"
password: "{{ SN_PASSWORD }}"
instance: "{{ SN_INSTANCE }}"
state: present
table: incident
data:
short_description: "KEEPALIVE"
severity: 3
priority: 2
caller_id: "System Administrator"
comments: "The is the fake message to keepalive this SNOW incident"
register: snow_var
- name: VISUAL OUTPUT OF INCIDENT NUMBER
debug:
var: snow_var.record.number
# Pause for 5 seconds to build app cache.
- pause:
seconds: 5
- name: DELETE THE INCIDENT
snow_record:
username: "{{ SN_USERNAME }}"
password: "{{ SN_PASSWORD }}"
instance: "{{ SN_INSTANCE }}"
state: absent
table: incident
number: "{{snow_var['record']['number']}}"