-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathincident_create.yml
More file actions
27 lines (23 loc) · 978 Bytes
/
incident_create.yml
File metadata and controls
27 lines (23 loc) · 978 Bytes
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
---
- name: Creating an Incident Ticket because something went wrong
hosts: localhost
gather_facts: no
tasks:
- name: Create the incident ticket
register: incident_info
servicenow.itsm.incident:
state: new
caller: "{{ caller_name }}"
short_description: "Ansible Automation Platform - Job ID: {{ my_job_id }} - Template named: {{ my_job_template_name }} - failure see description."
description: "ServiceNow Request: {{ ticket_number }}\n\nAnsible Job ID: {{ my_job_id }}\n\nTemplate named: {{ my_job_template_name }}\n\n Message: {{ my_error }}"
impact: low
urgency: low
other:
assignment_group: "Ansible West Tigers"
- name: Print out the Incident info
ansible.builtin.debug:
var: incident_info.record.number
- name: Capture the Incident Ticket number
ansible.builtin.set_stats:
data:
incident_ticket: "{{ incident_info.record.number }}"