3 Replies Latest reply on Sep 17, 2010 12:55 PM by Mike Langhorst

    Parameterized config files



      I would like to build a BlPackage which includes a config file. The config file has key/value pairs which are needed by the package. I'd like to be able to fill in value's by use of parameters.

      I've read some threads on this forum but i don't seem to understand how it should be done.




      The are mentioning to include ??TARGET.NAME?? style parameters.


      Can someone give me some description on how I should do this?


      let's say i have a config file for every package

      package.config which includes:

      hostname = ??TARGET.FQ_HOST??

      ip_address = ??TARGET.IP_ADDRESS??

      os = ??TARGET.OS??

      os_version = ??TARGET.OS_VERSION??

      packagename = ??NAME??


      is it possible to replace these values while installing the package?

        • 1. Re: Parameterized config files

          You are on the right track. Here are two ways for you to do it.


          1)You can build your config file completely at run time. I recommend this if the only thing in your file is entries from BladeLogic, and is not all name equal value pair.


          Add all of the files to your BLPackage except the config file. Add properties to your BLPackage that are something as follows:




          OS = ??TARGET.OS??


          PACKAGENAME = /foo/bar/configfilename


          Just place the external command in the right order of your BLPackage so that the file is created before any commands to install or start your package are executed and you will be fine. If you do need this to be flexible with the packagename, then leave the string blank as stated above, and you can set the value of that property when you open up the corresponding deploy job for this BLPackage.


          2) Create a config file in BladeLogic for this. Do this if the config file is always going to be in the same location and is used for a distinct purpose. Create a new config file in the BladeLogic configuration object dictionary that has an name equal value pair grammar and is given a path to where your config file should be. Then, it is easies for the next steps, if you create a dummy config file with the values in the correct directory on a server. In your BLPackage import the dummy config file. You should now be able to browse all the nvp as individual child objects of the config file. Do the same steps of creating the properties as in solution #1. Now browse into your nvp objects and set the values. For example, click on the "hostname" entity in your BLPackage and then click in the value box. Replace the contents of that box with ??HOSTNAME??. Repeat that for the others. The rest is the same as above.




          Could you do all of the above without creating the local properties? I think so. But it is better practice to create the local properties as it is easier to see all property references on the "properties" sheet of the BLPackage than to search the external commands or all the individual entries of the BLPackage for bad references, etc.


          I hope I was able to help some way.

          • 2. Re: Parameterized config files

            Is it possible to do this via blcli or jython?

            • 3. Re: Parameterized config files

              Opened a support case, and create an RFE to add this functionality.  Here's hoping for 8.1.  I would love to be able to create blpackages automatically, triggered by our build server when new application files get built.