IBM Concert

Execute existing Ansible Playbook on a server 

Tue April 16, 2024 10:37 AM

Purpose of Workflow:  Execute existing Ansible Playbook on a server. 

 

Description:  The workflow opens a SSH session to a server running existing Ansible scripts.  The ansible script on the server is executed by the workflow using a shell command.  The workflow captures and parses the result of the Ansible script.  In this scenario, the Ansible playbook has a task to query the status of Ethernet interface eth1 on a VYOS router.  If the status of the interface is down, a Service Now ticket is opened and the output of the Ansible playbook is inserted in the details field of the SNOW ticket. 

 

List of requirements: 

 

RNA Version:2024.1.497 or later 

Ansible Server: Linux server running Ansible.   

ServiceNow:  Developer Version 

 

Environment Required: 

  • RNAneeded to get the list of network devices 

  • SSH serverRNA needs to be able to SSH to the server. 

  • Linux server UserID/Password for authentication 

  • ServiceNow: Developer instance that will be used to open service incidents 

 

Inputs: 

  • SSH server IP address 

  • Service Now instance login information 

Setup: 

  • Workflow: Opens an SSH session to the Linux server. 

  • Workflow: Executes the Ansible playbook using a Shell command.   

  • Workflow: Parse the output and look for the status of the ethernet interface 

  • Workflow:  If the interface is down, log in to Service Now and open a new incident. 

 

Instructions: 

To Run the Workflow:   

  • Execute the workflow. 

 

Expected results: 

A message indicating the status of the interface is shown. 

 

 

High Level Workflow Overview 

Text Box

Shape

Text Box

ShapeText Box

ShapeText BoxShapeText Box 

Statistics
0 Favorited
21 Views
1 Files
0 Shares
8 Downloads
Attachment(s)
zip file
Execute Ansible Playbook on a server -attachment (1).zip   1 KB   1 version
Uploaded - Tue April 16, 2024