
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.
THE FOLLOWING ARTICLE IS A SUGGESTED METHOD FOR DEVELOPING AND TESTING ORCHESTRATION CODE, AND IS NOT AN ENDORSEMENT OF ANY PARTICULAR PRODUCT MENTIONED.
DIFFICULTY LEVEL: ADVANCED
Assumes knowledge and/or familiarity of several different areas in ServiceNow and Windows.
____________________________________________________________________________
Have you ever ground your teeth in frustration that you didn't have a Linux environment to do your Orchestration development against! Well save your molars, and read on; because I show you how easy it really is to set one up!
To continue with my series on how to implement various environments in Oracle VirtualBox to do Orchestration against I next have decided to tackle the Ubuntu Desktop. This will provide you with a way to do Orchestration development from your personal developer instance.
Here are links to my previous articles on VirtualBox and Orchestration development:
Mini-Lab: Orchestration - Creating your own Windows 2008 Server with VirtualBox
Mini-Lab: Creating your own AD Server with VirtualBox
Mini-Lab: Adding an LDAP Listener to Monitor AD in VirtualBox
Caveats:
I will be showing how to set things up to make use of the environment from ServiceNow Orchestration.
This is an Advanced level article. I will not be teaching:
- VirtualBox workings or installation
- Ubuntu Desktop workings, and I will be spending a minimum of time on the installation (I provide an excellent article link for that)
- Orchestration
- Workflow creation, or execution
- Ubuntu security
Pre-requisites:
Knowledge of ServiceNow workflows: Creation, execution
Knowledge of VirtualBox installation (Chapter 2. Installation details )
Knowledge of Ubuntu Linux commands, and how-to is useful
Install a MID Server on your local machine (MID Server Installation - ServiceNow Wiki )
Ubuntu Install on VirtualBox
1. Install Oracle VirtualBox - https://www.virtualbox.org/wiki/Downloads
2. Bring up VirtualBox
3. Download Ubuntu Desktop - http://www.ubuntu.com/download/desktop (64-bit version)
4. This is a pretty good instruction on how-to: http://www.beopensource.com/2016/05/how-to-install-Ubuntu-1604-LTS-in-Virtual-Box-VmWare.html (there are also several YouTube videos out on the web as well).
The following is the procedure I used based on the installation how-to.
5. Add a new machine in VirtualBox (machine -> new)
a. Name: Ubuntu Desktop
b. Click Next
c. Memory Size. Take the default. Click Next
d. Create a hard disk. Take the defaults.
e. Dynamically allocated.
6. Under storage find the IDE Secondary Master: [Optical Drive] Empty entry. Click on this.
a. Choose disk image.
b. Click on your downloaded version of Ubuntu desktop.
7. Choose the Ubuntu Desktop entry — and click on the Show button at the top.
8. Choose Install Ubuntu
9. Do not choose any of the update options. Click Continue.
10. Installation type. Take the default and click Install Now.
11. Where are you? Pick the appropriate time zone and click Continue.
12. Keyboard layout. Pick the appropriate entry and click Continue.
13. Who are you? Fill in your name, make up a computer name, user, and pick an easy password. Go get a cup of coffee. 🙂
14. When asked to restart, then do so. You may need to issue a reset if it gets stuck on the reboot.
15. Also, for me, I had to goto the Ubuntu Desktop menu -> Machine -> Settings -> Network and make sure it was set to Bridged Adapter.
16. Log into Ubuntu Desktop.
17. After logging in it is a good idea to use the Updater to pull down the latest stuff.
18. Open a terminal window and do an ifconfig command. Not down your inet ip address: _________
19. Install the OpenSSH Server. The first command installs the OpenSSH server. The second will force a restart.
From a terminal:
a. sudo apt-get install openssh-server
b. sudo systemctl restart ssh
If you desire more information the following article is a great resource:
https://help.ubuntu.com/community/SSH/OpenSSH/Configuring
You are now done with the Ubuntu setup!
MID Server
1. If you have not already done so you will need to set up a ServiceNow MID Server on your local device (preferably the one you installed VirtualBox on). No special modifications are needed to work with Orchestration and the Ubuntu Desktop.
ServiceNow Discovery 101: Setting Up a Local MID Server
2. Make sure your MID Server is running.
Orchestration
From your ServiceNow instance:
1. Create a new Credential. SSH Ubuntu. User name and password will be those you created while installing Ubuntu. Tag: Ubuntu. The credential should look something like this:
2. Create an Orchestration workflow based on the Global table, and give it a name like Ubuntu Tester. Your workflow should look llike the following:
a. The Initialize Run Script Activity has the following script:
workflow.scratchpad.host = '10.10.10.248'; // your Ubuntu Desktop ip would go here
workflow.scratchpad.command = 'ls -l';
b. The Check Ubuntu Desktop SSH Command Activity would look something like this:
Run the Workflow
1. From the Orchestration editor run your Ubuntu Tester workflow. Since your workflow is based on the Global table you should see the run button lit up in the workflow editor.
a. If you get the following error in the ECC queue you will need to verify the credential in ServiceNow for your Ubuntu desktop.
b. If you get the following error it is because you either don't have an SSH server installed on your Ubuntu desktop, or it isn't started. You will need to verify both.
2. The successful run should look like this:
3. Your ECC queue entry should look like this after a successful run:
And that is all there is to it! You now have the ability to do some serious work with Orchestration and an Ubuntu Desktop. Sky's-the-limit! 🙂
I want to highly recommend taking the ServiceNow Scripting and ServiceNow Orchestration training classes should you get the opportunity. The Scripting class will cover scripting workflow activities, and the Orchestration class will build on that and show how to create more complex workflows than that covered in this exercise.
Steven Bell
For a list of all of my articles: Community Code Snippets: Articles List to Date
Please Share, Like, Bookmark, Mark Helpful, or Comment this blog if you've found it helpful or insightful.
Also, if you are not already, I would like to encourage you to become a member of our blog!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.