Orchestration Puppet Activities

From ServiceNow Wiki
Jump to: navigation, search
Configuration Automation

1 Overview

Several Orchestration activities are available for managing Puppet configurations.

2 Determining Puppet Activity Result Values

Puppet activities communicate with a Puppet Master through a MID Server. When a Puppet activity sends a request, the MID Server sends a response to the ECC Queue. All Puppet activities set their activity.result value based on the response payload from the MID Server. If this payload contains an error, the activity result value is failure. If the the payload contains no error, the activity result value is success. For more information about activity.result, see Using the Activity Result Value.

3 Install Module

The Install Module activity installs a module to a Puppet Master or puppet node. This activity implements the behavior detailed by the puppet-module Install action.

3.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master or node you want to install the module to. A Puppet Master must have a module before it can push that module to individual puppet nodes.
Module name The name of the module you want to install. Enter module names using the format provider/module name, such as puppetlabs/apache. You can find a list of module names by viewing your module repository.
Version The version of the module you want to install, in the format #.#.#, such as 0.0.3. Leave this field blank to install the latest available version of the module.
Module path The directory path you want to install the module to. This path can be any location on the puppet node.
Module repository The repository that contains the module you want to install. For example, you can access the Puppet Forge repository at forge.puppetlabs.com.
Ignore dependencies Option to have this activity not attempt to install dependencies along with the specified module. For example, when installing the apache package, if you select Ignore Dependencies, ServiceNow does not install the stdlib or firewall package dependencies.
Force Option for overwriting any existing module with the same Module name.

4 Uninstall Module

The Uninstall Module activity removes a specified module from a Puppet Master or Puppet node. This activity implements the behavior detailed by the puppet-module Uninstall action.

4.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master or node you want to uninstall the module from.
Module name The name of the module you want to uninstall. Enter module names using the format provider/module name.
Version The version of the module you want to uninstall. Leave this field blank to uninstall the latest version of the module.
Module path The directory path of the module you want to uninstall.
Force The option to uninstall the specified module even if doing so causes dependency issues on the Puppet Master or node.

5 Sign Puppet Node

The Sign Puppet Node activity signs the certificate request for a Puppet node. Use this activity to allow a Puppet Master to recognize a certificate from a Puppet node.

5.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master that should manage the Puppet node.
Node FQDN The fully qualified domain name of the Puppet node whose certificate the Puppet Master needs.

6 Get Manifests

The Get Manifests activity retrieves a list of the manifests that are part of the installed modules on a Puppet Master or node.

When successful, the activity stores the manifests as a JavaScript array called puppetManifests. Access this JavaScript array in the sensor script by calling the puppetManifests variable. The activity does not add this variable to the workflow scratchpad.

Each object in the array contains:

  • basename: the name of the manifest file.
  • path: the path where the manifest is installed.
  • content: full textual content of the manifest file.
  • classes: JavaScript array of the classes in the manifest. Each class has these fields:
    • name: name of the class.
    • inherits: name of the class that this class inherits, or blank if the class does not inherit anything.
    • params: JavaScript array of the input parameters this class takes. Each parameter has these fields:
      • name: the parameter's name.
      • defaultValue: the parameter's default value, or blank if there is no default value.

6.1 Input Variables

Field Description
Puppet master The IP address of Puppet Master you want to retrieve manifests from.
Sensor script JavaScript that runs after the command executed by the activity completes. Use this script to process any data returned by the command.

7 Get Modules

The Get Modules activity retrieves a list of the modules that are installed on a Puppet Master or Puppet node.

When successful, the activity stores the modules as a JavaScript array called puppetModules. Access this JavaScript array in the sensor script by calling the puppetModules variable. The activity does not add this variable to the workflow scratchpad.

Each object in the array contains these fields:

  • name: the name of the installed module.
  • path: the path where the module is installed.

7.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master that contains the module you want to retrieve.
Sensor script JavaScript that runs after the command executed by the activity completes. You can use this script to process any data returned by the command.

8 Get Node Certificates

The Get Node Certificates activity retrieves a list of the node certificates that are signed, requested, or revoked for a Puppet Master.

When successful, the activity stores the certificates as a JavaScript array called puppetNodeCerts. Access this JavaScript array in the sensor script by calling the puppetNodeCerts variable. The activity does not add this variable to the workflow scratchpad. Each object contains the arrays signed, revoked, and requested.

Each array contains these fields:

  • hostname: the hostname of the node making the request.
  • cert_line: the full text returned by the Puppet Master for each node.

8.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master that has pending certificate requests you want to retrieve.
Sensor script JavaScript that runs after the command executed by the activity completes. You can use this script to process any data returned by the command.

9 Get Properties

The Get Properties activity retrieves configuration properties from a Puppet Master or Puppet node.

When successful, the activity stores the configuration properties as a JavaScript array of name-value pairs called puppetProperties. Access this JavaScript array in the sensor script by calling the puppetProperties variable. The activity does not add this variable to the workflow scratchpad.

9.1 Input Variables

Field Description
Puppet master The IP address of the Puppet Master that has the properties you want to retrieve.
Sensor script JavaScript that runs after the command executed by the activity completes. You can use this script to process any data returned by the command.
Was this article helpful?
Yes, I found what I needed
No, I need more assistance