Automating software package deployments in ServiceNow

Overview of automated software deployments

Use the ServiceNow Flow Designer to create an automated flow that integrates with the Tanium Deploy module to deploy software packages to endpoints. A software deployment flow orchestrates all deployment actions based on a trigger that you specify, such as creating a new service catalog. Automation eliminates manual tasks beyond the initial flow configuration, and thereby improves productivity in your organization and reduces the chance of human errors.

The following figure shows an example flow for automatically deploying software to endpoints every month. This example is useful for understanding the triggers and actions that are common to many automated software flows.

Figure 1. Flow for automated software deployments
Flow for automated software deployments

Tanium Patch Management for IT Operations provides predefined actions for software deployments that you can reuse for your own custom flows, as described in Predefined actions for software deployments. The processes and policies of your organization determine the specific triggers and actions that you configure.

Note: The following sections assume familiarity with the ServiceNow Flow Designer. For more information, see the Flow Designer documentation.
Note: Test each action before adding it to a flow, as described in Test an action.

Predefined actions for software deployments

Tanium provides the following actions that you can use to create software deployment flows.

Table 1. Predefined actions for software deployments

Action

Description

Create Tanium Patch Request - Software Deployment

Creates a record in the Tanium Patch Request table with Deployment type set to Software Package or Software Bundle.

Use the action inputs to specify the software package, operation, timing, and optional end-user notifications. For an example of how to use this action in a flow, see Create a Tanium Patch Request for a software deployment.

Add Computer Groups by Filter to Patch Request (Software Deployment)

Adds all computer groups that match a specified filter to a Tanium patch request.

The computer group must be active. Use this action as an alternative to Add endpoints to Patch Request from Change when you want to target endpoints by computer group membership rather than by change request.

Configure the following inputs for this action:

  • Tanium Patch Request: Select the patch request created in Create a Tanium Patch Request for a software deployment.

  • Computer Group Filter: Define the filter conditions to match the computer groups to add to the patch request. Only computer groups that are active, have an ID, and are associated with a server are added. The action outputs the sys_ids of all computer groups that were successfully added.

Note: This action only applies to patch requests with a Deployment type of Software Package or Software Bundle.
Figure 2. Add computer group by Filter to Patch Request
Add computer group by Filter to Patch Request

Add Endpoints by Filter to Patch Request

Adds all endpoints that match the specified filters to a Tanium patch request.

Configure the filters to include only endpoints with the same operating system (OS) as the OS that the patch request specifies. The following example shows a filter that includes only Windows endpoints that are virtual machines (VMs).

Figure 3. Add Endpoints by Filter to Patch Request
Add Endpoints by Filter to Patch Request

Add Endpoints to Patch Request from Change

Adds endpoints that are targeted in a change request to a patch request.

When you open an existing change request, the Affected CIs tab shows the targeted endpoints.

Add Tanium Computer Groups to Patch Request from Change (Software Deployment)

Adds computer groups from a Change Request to a Tanium Patch Request. Configure the following inputs for this action:

  • Change Request: Select the change request that contains the computer groups you want to add.

  • Tanium Patch Request: Select the target patch request.

Check if Patch Request is ready

Checks whether all required fields in a software deployment request are populated, in which case the request is ready to proceed with deployment.

Use this action to verify that a deployment can succeed or to generate useful error messages if the request is not ready. Always run this action before running Trigger Patch Request Deployment. For an example of how to use this action in a flow, see Check if the patch request is ready.

Trigger Patch Request Deployment

Runs the patch request, which creates a deployment in the Tanium Deploy module.

Always run the action Check if Patch Request is ready before running this action. For an example of how to use this action in a flow, see Trigger patch request deployment.

View, edit, or create flows

Perform the following steps to view, edit, or create a flow. Each new or existing flow opens in a separate tab in the ServiceNow Flow Designer. Switching between tabs can help you create a new flow by basing it on the components of an existing flow.

  1. Sign in to your ServiceNow instance.

  2. In the Main menu, click All, enter flow designer in the filter Filter field, and click Flow Designer.

  3. Click Flows to view all the existing flows. To view all the components of a specific flow, click its Name to open the flow in a new tab. If you edit any component, click Done in the corresponding section. After you finish making all your edits, click Save in the flow toolbar.

  4. Create a flow by selecting New > Flow. For the remaining steps, see Building flows.

Figure 4. Flow Designer
Flow Designer

Configure the trigger

Configure a trigger that starts the flow based on the schedule your organization uses for software deployments. For example, to deploy a software package at the start of each month, set the Trigger to Monthly and set the Day of Month and Time values that suit your deployment window.

Figure 5. Schedule based trigger
Schedule-based trigger

Set flow variables

Set the variables that provide input for other actions in the flow. In this example, you add the following variables:

  • Requestor: Select the user role that is responsible for creating change requests. In this example, the role is System Administrator because patching can have a significant impact on your network and therefore warrants a highly privileged role.

  • Assignment Group: Select the team that is responsible for reviewing and approving change requests that initiate patch requests. In the example flow, the team is CAB Approval

  • Software Bundle: Select the bundle to deploy.

Figure 6. Set flow variables
Set flow variables

Create a change request

Create a change request if desired. In this example, this action creates a record (State equals New) in the Change Request table and populates the record fields with the values that you specify. This example uses the following values:

  • Short description helps other users understand the purpose of the change request.

  • Requested by and Assignment group are set to the variables that you specified in Set flow variables.

  • Planned start/end date are set to the trigger that you configured in Configure the trigger.

  • Category is set to System Software because the requested change is for a software change.

Figure 7. Create change request record
Create change request record

Add computer groups to a change request

If you added a step to create a change request, you can optionally use the Create Change Request Computer Groups Record action. This action adds computer groups to the change request record to identify the groups to target.

Figure 8. Create change request computer groups record entry in a flow
Create change request computer groups record entry in a flow

After adding computer groups, the change request record shows the selected groups in the Tanium Computer Group table.

Create a Tanium Patch Request for a software deployment

The action Create Tanium Patch Request - Software Deployment creates a record in the Tanium Patch Request table with Deployment type set to Software Package or Software Bundle, depending on the options that you choose. Configure the following inputs for this action.

Table 2. Software deployment request settings

Setting

Description

Name

Enter a name to identify the patch request. Include identifying details such as the software package name and the flow start time.

Deployment Type

Select Software Package to deploy a single package or Software Bundle to deploy a bundle of packages.

Software Package [Tanium Deploy Software Definition]

Select the software package to deploy. The list is populated from the Tanium Deploy Software Definition table, which is synchronized from the Tanium Deploy module.

You can also pick from previous flow designer steps to pull in the requested software package, such as from a service catalog request.

Software Bundle [Tanium Deploy Software Bundle]

Select the software bundle to deploy. The list is populated from the Tanium Deploy Software Bundle table, which is synchronized from the Tanium Deploy module.

Deployment template

(Optional) Select a Tanium deployment template to apply predefined deployment settings. Templates are imported from the Tanium Deploy module.

Change [Change Request]

Select the change request that you configured in Create a change request.

Description

Enter a description to help other users understand the purpose of the deployment.

Start Time

Enter the time the deployment becomes active and eligible to run on endpoints.

End Time

Enter the cutoff time when the deployment window closes. Deployments cannot start after this time.

Distribute Over (Minutes)

(Optional) Randomize the deployment start time on each endpoint by an amount of time up to the value that you configure.

Override Maintenance Window

(Optional) Ignore maintenance window restrictions.

Frequency type

Select how often the deployment runs:

  • Single: The deployment runs once during the scheduled window.

  • Ongoing: The deployment continues to run on a recurring schedule.

Operation

Select a supported operation to perform on the software package.

  • Install: Installs the software package if it is not already installed.

  • Update: Updates the software package if a newer version is available.

  • Install or update (default): Installs the package if absent, or updates it if a newer version is available.

  • Remove: Uninstalls the software package.

Tip: Open the Tanium Deploy Software Definition record to view the supported operations.

Restart

(Optional) Select whether to restart the endpoint after deployment completes.

Download Immediately

(Optional) Select whether to allow endpoints to start downloading files before the deployment start time and ignore maintenance windows.

EUSS Available Before Start

(Optional) Select True to allow end users to initiate the deployment from the Tanium End-User Self Service (EUSS) application before the scheduled start time. The default is False.

Use Tanium Client Timezone

(Optional) Select True to interpret deployment start and end times in the local time zone of each endpoint, rather than in the time zone of the Tanium server. The default is False.

Pre Notification [Tanium End User Notification]

(Optional) Select a Tanium End User Notification to display to users before the software deployment begins. Notifications are imported from the Tanium Deploy module.

Post Notification [Tanium End User Notification]

(Optional) Select a Tanium End User Notification to display to users after the software deployment completes.

Check if the patch request is ready

This action checks whether all the required fields in the patch request are populated, in which case the request is ready for deployment. If the action determines that the patch request is not ready, ServiceNow shows the corresponding error message and the error handler flow starts if you configured it. For more information, see Add actions for errors.

When you create a software deployment flow, always include this action before the action Trigger Patch Request Deployment.

Trigger patch request deployment

This action runs the patch request, which creates a deployment in the Tanium Deploy module.

Add actions for errors

Optionally enable the Error Handler and add subflows, actions, and flow logic if you want to run a sequence of actions to identify and correct issues that occur during the patch flow. For example, you might want to log an error message and notify certain users by email. For more information, see Flow error handler.

Figure 9. Error Handler actions
Error Handler actions

Save, test, and activate the flow

Perform the following tasks after you configure all the triggers and actions for your patch flow:

  1. Click Save to save the flow configuration.

  2. Click Test to simulate a trigger and run the flow. Edit the flow if the test execution details show unexpected results. For more information, see Test a flow and Flow execution details. To troubleshoot patch request errors, see Troubleshooting patch requests in ServiceNow.

  3. Click Activate when the flow is ready to use.