Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

How to add a parameterized configuration file to a component template


The more you work with component templates and your environment, the more you become aware of what you need to track, remediate, and possibly eliminate. This section describes how to refine the objects in a component template, also known as the Parts.

Adding parts to a component template

The following example presents the basic steps for adding parts to a component template.

  1. Open your component template and choose the Parts tab. Then click Add g_V95_AddIcon.gifand select the part to add.
     In this example we are adding a specific WAR file, and also a related Windows Service.

    worddav2cabcca29c3f39e1c038ee18075aacad.png
  2. Click the Snapshot/Audit tab. For each part that you added in the previous step, validate what you want to capture as part of the Snapshot and Audit.
     In the example below, we selected Contents, which means Take a full backup of this object. This ensures that if someone changes this file, we can remediate it with the file in the Snapshot. Otherwise, we would only be able to remediate the file permissions and ownerships, which might not be sufficient.

    worddave563c682cbf833886c07bafb65075cd3.png

Adding configuration files

Sometimes you might care about a specific entry within a file, but not about the entire contents of a file. In the example below, the database.properties file contains a set of configuration entries for JPetStore. BMC Server Automation parses this file and treats every entry within the file as its own separate configuration object.

Because this configuration file is specific to JPetStore, we will define the configuration object within the component template. This is instead of defining the configuration file within the Configuration Object Dictionary, which would associate the configuration file with every server of a particular operating system.

worddavcb91e1259cca02eff05c1391de1b1eed.png

  1. Within the component template, click the Local Configuration Objects tab. To add a new object, click Add g_V95_AddIcon.gif, select Configuration File and click Next.

    worddav810dedea4d1105de6b9c6840505aec3f.png
  2. Browse to the database.properties file on a server and click OK.

    worddav88efb318823715df5f229d3b7acd9f1b.png
  3. Because the JPetStore path is parameterized, we want to parameterize the configuration file, as well. To parameterize, insert a property into the path to the file.

    worddav08af8017ecff5ff2ebfeb1332dca9353.png
  4. Select the appropriate grammar file for parsing the file, and then click Finish.
     The grammar file determines how to separate each entry within the file into a unique object, and must match the formatting of your file.

    worddav0543d4fa950ceb47555a369369a5b245.png
    The custom Configuration File object is displayed within the JPetStore component template.

    worddav35143700f432650f35b86d269e09ff89.png
  5. Include the configuration file as a part within the component template. On the Parts tab, add the Local Config File and click OK. Then save the Component Template.

    worddavc3c5b5d3b0b2452e5a5f850def8c6e66.png

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*