Is there any restriction that you want to use BLpackage only?
Because, I can think of creating an NSH script which will take targets (or servers) as argument, get its location from its server property and then copy the required content based on the location. Run this script using NSH script job.
The there is not really such a restriction.
However running that through NSH it's not really a deployable content that appears as deployed under PackageTracking.
Also when included in a Compliance Remediation scenario an NSH script isn't of any help.
Ideally I have a single rule that checks if the correct file is in place and if not deploys it with a single package.
But as we talk about Windows here, doing that with a single package isn't straight forward.
The remediation package could be an NSH script reads the server location property, or does some other calculation to determine the location and then executes the correct BLPackage deploy job. (location1_deploy or location2_deploy)
That way you still have the benefits of a blpackage to update the entries correctly in something like a host file.
If the configuration is more static say something like different static routes per location and you have a server location property you can include all the configuration files in the blpackage and execute/copy the correct one as part of the package.
So the blpackage contains location1routes.cmd and location2routes.cmd, and a custom action can be defined to run ??TARGET.LOCATION??routes.txt and it will execute the correct one - similar approach to copy the correct file to the final location
set some server properties that contain the correct hosts entries (maybe in a a custom psi) and then in the blpackage reference that property...
Sure but we want to avoid this as the DMZ build topic only affects 1% of our server environment.
I was hoping to store the content in a local property of a blpackage and then have some nice logic that puts the correct content in place based on some target properties.
I know it can be done with external commands, but doing that with dos cmd is soooo clumsy.
But on the other hand, having to tell my Windows Engineering team that we need a NSH script for that also seems less than ideal.
I guess it comes down to the two ideas i've alraedy raised about "condition in a blpackage" and a layer higher the "conditional deploy job"