Completion workflows in vCommander® are created to handle automation you wish to take place after a component or service has been deployed. Of the many types of steps available to administrators designing a completion workflow, this article will be concerned with the Execute Script step, and its particular use to install software packages.
Creating a Completion Workflow with Installation
The example here will be built around scripts and tools included in Embotics’ reference scripts, as used in a completion workflow configured to run when a new VM has been deployed. The example product is Symantec Antivirus, but the same process can be used with any installer that supports non-interactive installation.
- Download the reference scripts attachment to the vCommander application server.
- Extract the files psexec.exe and deployav.bat to C:\scripts\.
- Edit deployav.bat replacing <remote file server> with the actual network location where you are storing the files being called (%fileshare%\WIN_32Bit_Clients\SAV_WIN_32Bit_Clients_Setup.exe and%fileshare%\WIN_64Bit_Clients\WIN_64Bit_Clients_setup.exe).
- Browse to Configuration > Service Request Configuration and switch to the Completion Workflow tab.
- Click Add.
- Provide a Name and choose to Apply this workflow: after a VM is deployed. Click Next.
- On the Steps page, click Add and choose Execute Script.
- Enter a Name for the step.
- Leave Step Execution set to Always Execute. Later in this article, we’ll look at a way to make it conditional based on choices users made when ordering the service.
- Set the Timeout value to 600 seconds to provide enough time for the installation to complete. You may have to tweak this setting based on actual timing in your environment.
- Set Script Output to Capture script output as comment.
- Set the When Script Fails action to Mark workflow step as failed: do not proceed.
- Add the following Command Line, replacing the Administrator credentials with those correct for your domain, and click Next:
c:\scripts\psexec -i 2 -u <domain\administrator>-p \\#{target.ipAddress} -c -f c:\scripts\deployav.bat
- Choose to either Apply this workflow globally or Apply this workflow to selected components, choosing appropriate services. You’ll likely want to choose the later, unless the installers you will call are appropriate for all services. For example, selecting all Windows services and exclude those based on Linux. Click Next.
- Review your choices and click Finish.
Adding Custom Attributes for Installs
If you want to allow your customers to choose whether or not to perform an install using this completion workflow, the first thing you must do is create a custom attribute to provide the choice on the forms they are using.
- Browse to Configuration > Custom Attributes.
- Click Add.
- Name the attribute Install AV? or similar and provide a Description if you prefer.
- Choose Applies To: Form.
- Select List as the Type.
- Leave Edit in Service Portal checked. Click Next.
- Enter Yes in the text field and click Add. Repeat for No and then click Finish.
- Browse to Configuration > Service Request Configuration and switch to the Form Designer tab.
- Select a VM component form that will be accessible by users to whom you want to provide this choice. The design view of this form appears in the center pane.
- Under the Toolbox pane, click Custom Attribute. A new Custom Attribute element is added to the design view pane.
- Select Install AV? from the list of Custom Attributes.Click OK.
- Click Save.
Making Installer Steps Conditional
As a last configuration, the workflow created earlier can be edited to make the step conditional, so that only those requests where the form field Install AV? was answered Yes will get the installation.
- Browse to Configuration > Service Request Configuration and switch to the Completion Workflow tab.
- Select the workflow created earlier and click Edit.
- Click Next.
- Select the Install Antivirus step and switch Step Execution to Execute when conditions are met. Click Edit.
- Add the condition
#{request.service.settings.customAttribute['Install AV?']} -eq Yes
and click OK. - Click Next twice and then Finish.
See Also
vCommander also integrates with other systems to acheive custom installation options for generic services. See the current topics in our online help for more information: