Using the multi-server template push extension
The multi-server template push extension provides an easy way to deploy a template from a source server to a number of devices, which might be present on one or more destination servers. You can pass the device list to the extension through an XML file or a CSV file. For each destination server, the template push extension executes the Deploy to Active action where the template is deployed to the active configuration of the devices that match the given list of target devices. This extension is a web service client that is launched by running a script by using the CLI.
Note
- Ensure that JRE 8 is installed on the computer on which this utility is run.
- For single server push extension, you can provide the runtime parameters required for the template in a CSV file and pass that file as an argument to the script. While, for multi-server push extension, the script prompts for the runtime parameters during execution.
This topic includes the following sections:
About the multi-server template push extension
The multi-server template push extension is installed with BMC Network Automation. Before using it, expand the BCAN_HOME\public\bmc\bca-networks\extras\bcan-template-push-extension-v.r.mm.zip file into any convenient directory.
Tip
For consistency with other utilities, expand the file into the BCAN_DATA directory.
Expanding this file creates a bcan-template-push-extension subdirectory structure. The following utility script is included in the bcan-template-push-extension\bin directory:
- (Windows) multi-server-template-push.bat
- (Linux) multi-server-template-push.sh
The bcan-template-push-extension\bin directory also includes the MultiServerTemplatePushTargetParams.xml and TemplatePushConfig.xml files, in which you need to specify various parameters.
MultiServerTemplatePushTargetParams.xml
This input file enables you to specify the following target parameters:
deviceList: Includes names of devices on which the template is deployed.
Note
You can also specify this input by using a CSV file and pass that file as an argument to the
–deviceList
option as<devicename>,<devicename>,<devicename>
. For example,Aceess1,Edge2,CiscoAgg1
. For more information, see Launching the multi-server template push extension.- serverInfo: Includes the details of the target servers (such as the URL and authentication details) on which the devices in the device list reside.
The following code snippet shows the MultiServerTemplatePushTargetParams.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--target Params device list, destination server list -->
<tpeTargetParams>
<!--list of devices -->
<deviceList>
<deviceInfo>
<name><!--name of device --></name>
</deviceInfo>
<deviceInfo>
<name><!--name of device --></name>
</deviceInfo>
</deviceList>
<!--list of destination servers-->
<destServerList>
<serverInfo url="<!--destination server url-->">
<password><!--password for authenticating server--></password>
<username><!--username for authenticating server--></username>
</ServerInfo>
<serverInfo url="<!--destination server url-->">
<password><!--password for authenticating server--></password>
<username><!--username for authenticating server--></username>
</ServerInfo>
</destServerList>
</tpeTargetParams>
TemplatePushConfig.xml
This input file enables you to specify the following parameters:
- maxConcurrentTemplatePush: Specifies the maximum number of template push actions that can be executed in parallel.
- senderEmailAddress: Specifies the sender's email address.
- smtpGateway: Specifies the SMTP gateway details.
- sourceServerInfo: Specifies the details of the server on which the template is present.
- wsRequestTimeoutInMilliseconds: Specifies the maximum time after which the web service request will time out.
The following code snippet shows the TemplatePushConfig.xml file:
<?xml version="1.0"encoding="UTF-8" standalone="yes"?>
<!--source server details, email sending details, timeoutmillis for template push-->
<tpeConfig>
<maxConcurrentTemplatePush><!--maximum concurrent template push actions. This value should be between 1 and 30.-->
</maxConcurrentTemplatePush>
<senderEmailAddress>localhost@bmc.com</senderEmailAddress>
<smtpGateway><!-- smtp gateway --></smtpGateway>
<!--source server details -->
<sourceServerInfo url="<!--source server url-->">
<password><!--password for authenticating server--></password>
<username><!--username for authenticating server--></username>
</sourceServerInfo>
<!-- timeoutmillis for which server will be authenticated-->
<wsRequestTimeoutInMilliseconds><!-- long value for timeout --></wsRequestTimeoutInMilliseconds>
</tpeConfig>
Launching the multi-server template push extension
To launch the extension, modify the MultiServerTemplatePushTargetParams.xml and TemplatePushConfig.xml files, as required, and run the multi-server-template-push script from the CLI. When you run the script, it prompts you for the runtime parameters required for the template. You can specify up to 2000 characters in the runtime parameter value.
The multi-server-template-push script has the options listed in the following table:
Option | Description | Required? |
---|---|---|
-? | Displays help | No |
-deployTemplateName arg | Specifies the name of the template that must be deployed on the devices. If you do not specify this option, the extension generates an error message and exits the system. | Yes |
-deviceList arg | Specifies a .csv file that contains a list of device names.The file name must include the complete path to the file. If you do not specify this option, the device list in the MultiServerTemplatePushTargetParams.xml file that resides at the same location as the multi-server-template-push.sh file is used. | No |
-syntaxScan arg | Indicates whether a Scan Syntax action should be performed on the template before the Deploy to Active action. Valid values: true, false (default) | No |
-makeTrusted arg | Indicates whether a Mark As Trusted action should be performed on the resulting configuration of devices. Valid values: true, false (default) | No |
-commit arg | Indicates whether a Commit action should be performed on the resulting configuration of devices. Valid values: true, false (default) | No |
-email arg | Specifies a list of recipient email addresses to whom the template push summary report is mailed. You can specify multiple email addresses enclosed in quotation marks and separated by a space, for example "john_smith@abc.com shirley_thompson@hotmail.com”. If you do not specify this option, no email is sent. | No |
-format arg | Sets the format in which the template push summary report is mailed to the recipients. Valid values: RTF, HTML, PDF (default) | No |
Examples
The following table describes various use cases for the multi-server template push extension:
Example | Description |
---|---|
multi-server-template-push.bat -? | (Windows) Displays options available to launch the utility |
multi-server-template-push.bat -deployTemplateName newConfigtemplate | (Windows) Deploys newConfigtemplate on the target parameters specified in the MultiServerTemplatePushTargetParams.xml and TemplatePushConfig.xml files |
multi-server-template-push.bat -deployTemplateName newConfigtemplate | (Windows) Deploys newConfigtemplate on the devices specified in the devices.csv file Attached is a sample CSV file. |
multi-server-template-push.sh –deployTemplateName newConfigtemplate | (Linux) Deploys newConfigtemplate and performs the following actions:
|
multi-server-template-push.sh –deployTemplateName newConfigtemplate | (Linux) Deploys newConfigtemplate and sends a report in RTF via email to Shirley |
multi-server-template-push.sh –deployTemplateName newConfigtemplate | (Linux) Deploys newConfigtemplate on the devices specified in the js.csv file, sends
|
Comments
Log in or register to comment.