Scripting

Configure OneFuse Scripting policies to run scripts on SSH-enabled hosts

The OneFuse Scripting Module allows users to consume scripts as API-based services that are executed in context of a specific machine lifecycle (create/destroy) or independently on any SSH-based host.

The OneFuse Scripting Module allows OneFuse admins to create simple API-based services using Scripting policies that can connect to SSH-enabled hosts/devices, track the outputs as inventory items, and enable create/destroy for lifecycle support.

End users of automation tools such as VMware Aria Automation, Terraform, ServiceNow, and others can execute these Policies and consume the variable outputs. This allows you to drive your automation use cases simply and securely, without requiring direct access to the target host.

Create Scripting Policies

  1. In OneFuse, select Scripting from Home, or select Modules > Scripting from the left navigation menu.
  2. Select Create and fill out the Scripting Policy form.
  3. When finished, select Create.

Deployments

  1. View generated Scripting Deployments from Scripting Policy executions in the Deployments datatable. For a more detailed report, select the view icon to open the Job Summary, which includes API, Input, Result, and Logs.
  2. Select the details caret to view the Provision Script’s JSON output.

Lifecycle management

Provision and deprovision using Scripting with the OneFuse API or an Upstream Provider. Follow the steps below to set up provisioning and deprovisioning in OneFuse.

Provisioning

  1. Create a new Scripting Policy or select the Edit icon on an existing policy.
  2. Select the Provisioning tab.
  3. Enter the Provisioning form field requirements.
  4. Select the Deprovisioning tab to enter Deprovisioning commands and script templates, or select Create/Update to save.

Deprovisioning (optional)

  1. Create a new Scripting Policy or select the Edit icon on an existing policy.
  2. Select the Deprovisioning tab.
  3. Enter the Deprovisioning form field requirements.
  4. Select Create/Update to save.

Scripting Policy form fields

Field Description
Scripting Policy Name Enter a name for the Scripting Policy.
Description Optional description for this Scripting Policy.
Target Host Define the target host on which to run scripts.
Module Credential Select an existing Module Credential. Type to filter.

Provisioning and deprovisioning form fields

Field Description
Launch Command Launch command to run the script on the target host. Reference the rendered script with {{ ScriptName }}.
Script Template Enter the script using a mix of static and templated text to run on the target host.
Success Exit Code(s) Enter success exit codes as comma-separated numbers. Success is determined by matching the exit code(s) against the script’s exit code.

Disable OpenSSH on Windows servers

Use OneFuse Scripting to uninstall OpenSSH from Windows servers via a bastion host

Install packages with Chocolatey

Use OneFuse Scripting to install packages with Chocolatey on Windows servers

Execute PowerShell scripts using a bastion host

Use a bastion host to execute PowerShell scripts via the OneFuse Scripting Module

Produce output from Scripting policies

Capture JSON output from OneFuse Scripting policies