Creating Depot objects and Deploy Jobs using Network Shell Commands


Use the puppetpackager.nsh and module2blpkg.nsh NSH commands to create the Puppet Agent bundle and execute Puppet modules on the target.

Prerequisites

Before you use Network Shell Commands to create Depot objects and Deploy Jobs for Puppet, ensure that you have performed the following tasks:

  • Install NSH, Remote System Call Daemon (RSCD) Agent, and BLCLI on the client machine.
  • Acquire TrueSight Server Automation credentials and perform the BLCLI authentication on the servers on which you are planning to run the Puppet modules so that you can connect to the TrueSight Server Automation Application Server. Use the blcred cred -acquire command to acquire credentials.
  • Set the BL_AUTH_PROFILE_NAME environment variable to the authentication profile that you want to use.

Creating Deploy Jobs for Puppet Agent bundle using the puppetpackager.nsh command

TrueSight Server Automation includes the puppetpackager.nsh NSH script for creating platform-specific Puppet Agent bundles. This script enables you to create Depot objects that contain Ruby, Puppet, and Facter clients for a particular OS version and architecture. The depot objects can then be used to deploy the Puppet Agent bundle to TrueSight Server Automation managed hosts.

Notes

  • Do not move or rename the Depot object after it is created.
  • Do not rename the Deploy Job after it is created.

The following screenshot shows a sample Puppet Agent Deploy Job, which is created in the Jobs folders:

AgentBundleHeirarchy1.png

By default, the package will be created for the OS version and architecture of the system on which the script is run. However you can also pass the OS name, version, or architecture as options to this script.

Syntax the puppetpackager.nsh command

puppetpackager.nsh [-n OSName] [-v OSVersion] [-a OSArchitecture] -r <pathToRuby RPM> -p <PuppetVersion> -i <pathToPuppetAgentInstaller> -f <pathToFacterInstaller> [-d </AbsolutePath/dependencies.lst>] [-h ManagedHostname for aiding BSA job creation] [[-T CommonFileLocationType] | [-t CsvListOfFileLocationType]]

In this script, specify values for the following variables.

  • OSName: 'el' for Enterprise Linux or 'ubuntu' for Ubuntu.
  • OSVersion is either 5 or 6 for Enterprise Linux and 11 or 12 for Ubuntu.
  • OSArchitecture is either x86_64 or i686.
  • Provide the Ruby interpreter as an RPM, pathToRubyRPM, by using the -r option.
  • Provide the PuppetVersion by using the -p option.
  • Provide the pathToPuppetAgentInstaller by using the -i option.
  • Provide the pathToFacterAgentInstaller by using the -f option.
  • AbsolutePath/dependencies.lst specifies the absolute path to a comma-separated list of dependencies to be installed before installing Puppet and Ruby.
  • ManagedHostname specifies the name of a TrueSight Server Automation managed host, which is required for creating jobs. This host is used temporarily only for job creation and is not retained as a job target, so it can be any managed host. If you do not specify this parameter, the script uses the string localhost. If a target with the name localhost is not a TrueSight Server Automation managed host, the script fails to run.
  • CommonFileLocationType is a flag that indicates the type of path being passed for Ruby, Puppet, Facter, and other installers.
  • CsvListOfFileLocationType, is used if some installer files have a different location. You need to specify the type for all installers. The first three values in this list are for Ruby, Facter, and Puppet respectively. The rest are for dependencies.

Creating deploy jobs for importing Puppet modules using the module2blpkg.nsh command

After you have installed the Agent bundle, you must import and deploy the Puppet modules on your target. BMC recommends that you have the Puppet module installed and tested on a test server, before deploying it on your target. The module2blpkg.nsh script is used to create Depot objects and Deploy Jobs to execute the Puppet module on managed hosts.

For each Puppet module TrueSight Server Automation creates a batch job and a module job. The batch job installs the Puppet Agent bundle and executes the Puppet module on the target server. It can be executed in case the Puppet Agent is not already installed on the target. If the Puppet Agent is already installed on the target, you only need to execute the module job.

You can find the Deploy jobs under the Jobs folder, as shown in the following figure:
Module_Heirarchy1.png

Notes

  • Do not move or rename the Depot object after it is created.
  • Do not rename the Deploy Job after it is created.

Syntax for the module2blpkg.nsh command

module2blpkg.nsh [-V] [-h ManagedHostname for aiding BSA job creation] -f </Abs
olutePath/ModuleList.lst>
  • ManagedHostname specifies the name of a TrueSight Server Automation managed host, which is required for creating jobs. This host is used temporarily only for job creation and is not retained as a job target, so it can be any managed host. If you do not specify this parameter, the script uses the string localhost. If a target with the name localhost is not a TrueSight Server Automation managed host, the script fails to run.
  • AbsolutePath/dependencies.lst specifies the absolute path of a comma-separated list, which contains the absolute paths of tar.gz bundles required for the Puppet modules. Each bundle should be named so as to indicate the module it is providing and should contain all the dependency modules.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*