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.
- Open your component template and choose the Parts tab. Then click Add
In this example we are adding a specific WAR file, and also a related Windows Service.
and select the part to add.
- 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.
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.
- Within the component template, click the Local Configuration Objects tab. To add a new object, click Add
, select Configuration File and click Next.
- Browse to the database.properties file on a server and click OK.
- 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.
- 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.
The custom Configuration File object is displayed within the JPetStore component template.
- 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.