Why not use the random facility on the target to generate the string you need ?
I tried to do that by creating a Windows system variable. I need to create a variable so the execution script can locate the installer files. However, I had a trouble creating the variable with the random name from the BSA job.
Can you please provide an example I could use for Windows targets?
Yes, that code works locally but when placed in the blpackage the variable was not created on the target system. I also tried setx.
So you are setting the variable in an external command and using it in the same external command or trying to persist it through to another external command ?
I am trying to persist it through to another external command.
I would like to:
1. Create variable with random characters
2. Create folder using the variable
3. Deploy files within the BLPackage to the folder (created in step 2)
4. Execute installation command against files (deployed in step 3)
Automation Engineer – Enterprise Systems Management
Cloud and Infrastructure Solutions | Enterprise Services
Unisys Corporation | 1 Technology Park | Harrisburg PA 17110
Office - 717-409-5909
How are you going to deploy to that folder – there is no way to take something from an external command and push it back into the blpackage – so unless step 3 is an external command that copies from one location to another that won’t work.
Why do you need to have a random string here anyway ?
As I originally mentioned, it is for the best practice only. (In case the deployment folder would not get removed and the job was executed again, etc.) I think what I’m finding is that the complications outweigh the limited benefits.
Unless someone can suggest a totally differnet approach.
Best practice how ? blade will deploy everything that’s in the blpackage to the target. so when you run whatever commands in the blpackage, everything should be on the target.
You could initiate the random_name in the property dictionary, then feed the name to your blpackage, execute the bl package, execute an nsh script that would update the random_name with a new value.
Execute a batch (bl package deploy, nsh script to update value) against the server you want to put the randomly named folder on
We are trying to account for minute possibilities. For example:
1. Someonelse creates a folder in the same location with the same name. This scenario is possible since we host the servers for customers with their own admins.
2. The blpackage job fails before completion and the deployment folder remains. The blpackage is updated. The job is re-excuted. 3rd party application installation might use old config files.
These are minute possibilities, but as developers and automation engineers, we like to account for all that, if possible.
pretty sure you can just build those checks into the bl package or run the nsh script first in the batch to update the random name in the dictionary, then check against the remote server to see if it exists, if so loop the update property process until it doesnt, then finally execute the bl package
Yes, sorry, I was replying to Bill. Your suggestion might work. We’ll have to talk it through. One possible drawback is that it could only be executed against a single server at a time or else the variable might change mid job.
depends if you run the batch in parallel or sequential