4 Replies Latest reply on Mar 31, 2011 7:52 AM by Paul Thorp

    Parameters in scripting or packages

    Paul Thorp


                      I am pretty new to bladelogic, and newly back in a technical role after a period out. I am trying to deploy patrol agents via bladelogic, and am trying to adapt and improve somebody elses scripts to do so. They currently have a seperate script for each package deployment  and execution, containing explicit references to filenames and paths in the package.


      The patrol agent deployment package consists of 2 files, installation image (a zip fie), alongside cizip. The path to deliver these to, being declared within the package itself as it drops the files. The script to execute the silent install then follows as part of a batch job, the installation script contains the same information relating to the paths as defined in the package. I have immediately adapted the script to make the several references to explicit paths use a variable set once in the script, but  I am really trying to get the pertinent information about paths to flow through the deployment, as using a separate script for every deployment is bonkers.


      I have used the package name as the defining source of the variable bit of the path information and therefore used the package name as a parameter, which now controls where the files are delivered to. The problem I have is that I’m not sure if i can, and certainly not sure how I  access this parameter of the package when the script runs. I don't really want to attach the script to the package as this defeats the object. I want them to be independant, but then linkable as required. I would be happy to link them in a batch job, and I thought I might be able to use the parameters of one part of the job (package name in the deploy job) in another part of the job (nsh script job), but couldn’t figure it out.


      The other way I thought to do it was to have the package set a custom parameter of the target machine,  because I think TARGET.??WHATEVER?? is accessible at all stages of the process. I was able to get basic BLCLi commands to run within the script, (didn’t get so far as to set the parameter) but was not able to get blcli commands to execute as part of the package. I’m essentially looking for the package to set a parameter on the target as it’s deployed to the target, and then the other parts of the package and the script that follows can use this value as a parameter.


      So 3 questions....

      Can I execute BLCLI commands within a package, or

      How do I get parameters local to the package to be available later on in the batch job or

      How do I acheive the aims another way?