-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
-----BEGIN PGP SIGNATURE----- | ||
|
||
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmYytUYACgkQTiIiIXrU | ||
DNH31Av+PLqHa8ThrN7l0yur/YKKvYSV8+ij78d8aVR127s1zKL1V/ehVK+7emnu | ||
TKv06e/iaFb4R+iDC2WqFScCxJ/Nlk1YuU7ZlCQlDjv4IBQuLjgr9bYO6BfK/QMz | ||
e9qnQy6qn81LTChebFP+l7wLRJjnfNpnx82Xi3S54gnB699wQED5H+pqnaWcJi++ | ||
fvrPtwzhjVsqXzDKRE2F77sapLVGA1ZH2bnwnEUxyHKV1k1ql9+2qHU+R0Zi6hwt | ||
FN9nUIiNURWraGKwJuH6+vvCPfhD6XSWeWk5/3/cs+x7NLdsdE7uBljn7rDgbgfr | ||
+F6ejY/83skkEc6w16uEuTWzKHjW76aY61WBdla9waEozMzS2OAKmNyGhCYjHWpk | ||
CdmfsEypFev4YvewQmiJMeO9rsPwbqjziF/nv1xlin4JedxXX+pdU7qZpeKAQgGV | ||
P2ZJgTI1Ek8YWsrIl4D1EOqw5r4npDo3mYy4ycgh9YgZSNA+7I9eDilIBO0FLNxU | ||
C22NmagI | ||
=/bjr | ||
iQGyBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmYzkGoACgkQTiIiIXrU | ||
DNHchAv1GhEfCyt7yh8eenj/RqjdP8VGD0MnWSqnxKRq6ZXwkiBUycdnblT4Sk5U | ||
O9R+PN7BgmZOgr3lfPNSnKE3rohbeFo0sNJLTmC3hv8BR3BAitzyezD0yh0JQI5A | ||
acngOlyUYsxI6f0BMOdUlCL0Man+3xH7eBujdQsYp6pNou2ssTCkd6PeMJVAhSck | ||
uLuzG7nyarZd4+UAtwxAtwbxG6+XS6OICTXsN5xardylmSLOhc25vArHzljwQdAa | ||
jbYdcDLfCzmujxiKI0De6w19fRKAjPp+6dXt+r8qbYmA4pZ2HvYVzY4X1yfpobOi | ||
JiW52xkggOl9YTW7apqZ7oymVOuZiYpbtAMWMMKl6aTpX4WrEqRtO7XXRnYIg2HH | ||
R64gnqO8zPDXFhW3mJnuxeG40KALr+PHPSQxD7EIyo1rtMsDsc94bFUo+KCG4wVS | ||
i1DEpxZ0OK80U+UA05KeOZa1U8xqm0oep0Ztiv7VRohjBR9Bmmkon0Iv3OKQQkRF | ||
5QctoAk= | ||
=w+v7 | ||
-----END PGP SIGNATURE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
- name: Check if category already exists | ||
servicenow.itsm.api_info: | ||
resource: sc_category | ||
sysparm_query: titleSTARTSWITHAnsible Jobs | ||
register: categoryresult | ||
|
||
- name: Create Catalog Category | ||
servicenow.itsm.api: | ||
resource: sc_category | ||
action: post | ||
data: | ||
title: "Ansible Jobs" | ||
sc_catalog: "Service Catalog" | ||
description: "Jobs launced from AAP" | ||
active: true | ||
when: categoryresult.record | length == 0 | ||
|
||
- name: Check if Catalog Item already exists | ||
servicenow.itsm.api_info: | ||
resource: sc_cat_item | ||
sysparm_query: nameSTARTSWITHProvision VM | ||
register: catalogitemresult | ||
|
||
- name: Create Catalog Item | ||
servicenow.itsm.api: | ||
resource: sc_cat_item | ||
action: post | ||
data: | ||
name: "Provision VM" | ||
sc_catalogs: "Service Catalog" | ||
category: "Ansible Jobs" | ||
active: true | ||
short_description: "Deploy a new virtual machine" | ||
when: catalogitemresult.record | length == 0 | ||
|
||
- name: Create Single Line Variable | ||
servicenow.itsm.api: | ||
resource: item_option_new | ||
action: post | ||
data: | ||
type: "Single Line Text" | ||
cat_item: "Provision VM" | ||
question_text: "What is your VM name?" | ||
name: "vm_name" | ||
active: true | ||
mandatory: true | ||
order: 100 | ||
when: catalogitemresult.record | length == 0 | ||
|
||
- name: Create Multi Select Variable | ||
servicenow.itsm.api: | ||
resource: item_option_new | ||
action: post | ||
data: | ||
type: "Select Box" | ||
cat_item: "Provision VM" | ||
question_text: "Pick your OS" | ||
name: "operating_system" | ||
order: 200 | ||
active: true | ||
mandatory: true | ||
when: catalogitemresult.record | length == 0 | ||
|
||
- name: Add Options to Multi Select Variable | ||
servicenow.itsm.api: | ||
resource: question_choice | ||
action: post | ||
data: | ||
type: "Select Box" | ||
cat_item: "Provision VM" | ||
question: "Pick your OS" | ||
text: "{{ item.text }}" | ||
value: "{{ item.value }}" | ||
order: "{{ item.order }}" | ||
loop: | ||
- { text: 'RHEL7', value: 'RHEL7', order: '100' } | ||
- { text: 'RHEL8', value: 'RHEL8', order: '200' } | ||
- { text: 'RHEL9', value: 'RHEL9', order: '300' } | ||
- { text: 'Win2016', value: 'Win2016', order: '400' } | ||
when: catalogitemresult.record | length == 0 |