Giter Club home page Giter Club logo

rundeck-servicenow-plugin's Introduction

rundeck-servicenow-plugin

This plugin can be used in a Rundeck workflow to create and close a Service Now change.

Features

  • Open a Service Now Change;
  • Close a Service Now Change;

How it works

Basically, we can create two types of steps using this plugin: open_change and close_change.

When open_change is used, the plugin will connect to Service Now, create a change and wait for approval. This step will finish when the Change was approved or rejected. If the change was approved, the plugin will finishes with success and the next step will be executed. If the change was rejected, the plugin will finish with error and the next step will not be executed.

When a change is created with this plugin, a file is created in a temporary filesystem with change information. This file is used for the close_change step to recovery a change number associated with the job id. So the action close_change can be used in two situations:

  • on the same job that open_change was used: the plugin will use the current job id to recovery the change information;
  • create a job with a step to close_change: this step uses ${RD_OPTION_JOB_ID} variable content, so you need to configure JOB_ID option passing the job id;

Requirements

This plugins uses Python3 to interact with Service Now, to work this plugins requires the following python libraries:

  • requests;
  • PyYAML;

To instal this libraries executes the following command:

$ pip3 install PyYAML requests

Be sure that the following path exists:

$ ls -l /usr/bin/python3

Build

make clean build

Install

cp build/libs/servicenow-approval-plugin.zip $RDECK_BASE/libext

Plugin configuration

The following configuration is required by the plugin:

  • servicenow_username:
    • description: Username with permissions to create a Change on ServiceNow.
    • type: String
  • servicenow_password:
    • description: Path to Rundeck Key Storage to access ServiceNow password.
    • type: String
  • servicenow_server:
    • description: URL to connect to ServiceNow.
    • type: String
  • servicenow_action:
    • description: Action to perform on ServiceNow. Needs to be open_change or close_change.
    • type: String
  • rundeck_server:
    • description: URL to connecto to Rundeck.
    • type: String
  • rundeck_token:
    • description: Path to Rundeck Key Storage to access Rundeck API token.
    • type: String

Example

ServiceNow Change form

To send data to ServiceNow, the options on the form must be in the following format: sn_<field_name>. If you create an Rundeck option sn_description, the following environment variable will be generated: RD_OPTION_SN_DESCRIPTION.

When the job runs, the script plugin will send all data with the environment variables prefix: RD_OPTION_SN_.

Example

Create a Standard Change using a template

To create a Standard Change, you need to create the following option in Rundeck job: chg_template_id and pass the template sys_id. This option will produce the environment variable RD_OPTION_CHG_TEMPLATE_ID that will be used by the Plugin to create a Change.

rundeck-servicenow-plugin's People

Contributors

ambrisolla avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.