Skip to content

Commit

Permalink
refactoring directions for servicenow demos
Browse files Browse the repository at this point in the history
  • Loading branch information
IPvSean committed Sep 6, 2019
1 parent fb412eb commit e92a345
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 70 deletions.
95 changes: 25 additions & 70 deletions demos/servicenow/1-config-drift/README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,57 @@
# ServiceNow Demo for Linklight

## Table of Contents
- [Setup](#setup)
- [Demo 01 - Config Drift](#Demo-01-Config-Drift)
- [Explanation](#explanation)

## Setup

- Setup a free account
https://developer.servicenow.com/

- Click **Manage** and create an instance

![manage](images/manage.png)

A URL will be provided like ```https://dev66073.service-now.com/```

- Login to your WebURL and reset your password.
![snow](images/snow.png)

- Record these three pieces of information that will provide authentication.

| Field | Input |
| -------- |:--------------------|
| username | admin |
| password | ThisIsAFakePassword |
| instance | dev66073 |

**Tip 1** the instance is part the webURL e.g. https://dev66073.service-now.com/ is `dev66073`

**Tip 2** the password is **not** the same as your password to login to https://developer.servicenow.com/. To reset it click on **Action** and then **Reset admin password**

![reset](images/reset.png)

- Install pysnow
https://pysnow.readthedocs.io/en/latest/

```$ pip install pysnow```

**Tip** When using Tower, use [this guide](https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html). Tower uses a virtualenv so the install changes slightly:

```
# source /var/lib/awx/venv/ansible/bin/activate
# umask 0022
# pip install pysnow
# deactivate
## Demo 01 - Config Drift
# Ansible + ServiceNow - Config Drift

### Objective

Demonstrate automatic ticket creation for configuration drift. When the configuration for a Cisco CSR router doesn't match desired config, a ServiceNow ticket with relevant information will be created.

### Guide
- Ansible Playbook will check for desired configuration on rtr1
- The configuration is missing, which generates a Service Now ticket indicating rtr1 is out of compliance.

#### Preface
This demo is built for the Linklight workbench. To use the demo it is recommended to run the [provisioner](../../provisioner/README.md) for **networking mode**. By standardizing demos on the Linklight workbench it is easier to test and verify demos are always working. Feel free re-use any component of this demo but this demo is only supported in this fashion.
#### Overview
- Playbook will check for desired configuration on rtr1
## Table of Contents

- The configuration is missing which generates a Service Now ticket indicating rtr1 is out of compliance.
- [Step 1 - Connect to workbench](#step_1_connect_to_workbench)
- [Step 2 - Provide ServiceNow credentials](#provide_servicenow_credentials)
- [Step 3 - Execute Ansible Playbook](#step_3_execute_ansible_playbook)
- [Step 4 - Show ServiceNow incidents](#step_4_show_servicenow_incidents)
- [Explanation](#explanation)

#### Step 1
## Step 1 - Connect to workbench

Connect to the Linklight workbench:
Connect to the workshop workbench:

```
[user@RHEL ~]$ ssh [email protected]
[email protected]'s password:
[user@RHEL ~]$ ssh [email protected]
[email protected]'s password:
```

Move into the `demos/servicenow` directory.
Move into the `demos/servicenow/1-config-drift` directory.

```
[student1@ansible ~]$
[student1@ansible ~]$ cd demos/servicenow
[student1@ansible ~]$ cd ~/demos/servicenow/1-config-drift
```


#### Step 2
## Step 2 - Provide ServiceNow credentials

Define the login information (username, password and instance) as defined in the [Setup](#setup). Fill this information out in `login_info.yml` with your text editor of choice.

```
[student1@ansible ~]$ nano login_info.yml
```

#### Step 3
## Step 3 - Execute Ansible Playbook

Run the `config_drift.yml` playbook:

```
[student1@ansible ~]$ ansible-playbook config_drift.yml
```

![snow](images/snow.gif)
![snow](../images/snow.gif)

#### Step 3
# Step 4 - Show ServiceNow incidents

- Login to the Web URL
e.g. `https://dev66073.service-now.com/`
Expand All @@ -109,7 +61,7 @@ Run the `config_drift.yml` playbook:

![snow](images/gui.gif)

#### Explanation
## Explanation

The Ansible Playbook runs a task to configure a Cisco CSR router.

Expand Down Expand Up @@ -168,4 +120,7 @@ Here is a snippet of ServiceNow task:
The block uses the conditional `when` to only run if the previous task **changed**. This means a ServiceNow ticket is only generated if the task actually reports changed.

# End of Demo
## End of Demo

---
![Red Hat Ansible Automation](../../../images/rh-ansible-automation.png)
53 changes: 53 additions & 0 deletions demos/servicenow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Ansible + ServiceNow Demos

These demos are intended for effectively demonstrating Ansible + ServiceNow capabilities with prescriptive guides on the Ansible Automation Workshop infrastructure.

# Table of Contents

- [Demo Catalog](#demo_catalog)
- [Common Setup](#common_setup)

# Demo Catalog

| Demo Name | Brief Description | Workshop Type | Uses Ansible Tower |
|---|---|---|---|
| [Config Drift](1-config-drift) | Demonstrate automatic ticket creation for configuration drift. When the configuration for a Cisco CSR router doesn't match desired config, a ServiceNow ticket with relevant information will be created. | `workshop_type: networking` ||
| [Closed Loop Incident Mgmt](2-closed-loop-incident-mgmt) | Ansible Tower will find the router that is out of compliance and open an incident in ServiceNow. ServiceNow will use a business rule to identify the newly opened incident, then kick off an Ansible Tower job to fix the issue. | `workshop_type: networking` | <font color="green">✓</font> |

## Common Setup

You must have the following setup to deliver these demos:

1. [A ServiceNow instance setup](#servicenow_setup)
2. The correct Ansible Workshop type provisioned (e.g. `workshop_type: networking`). Please refer to the table above for the corresponding `workshop_type`.

## ServiceNow Setup

- Setup a free account
https://developer.servicenow.com/

- Click **Manage** and create an instance

![manage](images/manage.png)

A URL will be provided like ```https://dev66073.service-now.com/```

- Login to your WebURL and reset your password.
![snow](images/snow.png)

- Record these three pieces of information that will provide authentication.

| Field | Input |
| -------- |:--------------------|
| username | admin |
| password | ThisIsAFakePassword |
| instance | dev66073 |

**Tip 1** the instance is part the webURL e.g. https://dev66073.service-now.com/ is `dev66073`

**Tip 2** the password is **not** the same as your password to login to https://developer.servicenow.com/. To reset it click on **Action** and then **Reset admin password**

![reset](images/reset.png)

---
![Red Hat Ansible Automation](../../images/rh-ansible-automation.png)

0 comments on commit e92a345

Please sign in to comment.