Use > Application Configuration concepts and tasks > Application Configuration concepts > Configuration templates and script templates

Configuration templates and script templates

A configuration template is a model of a configuration file with variables in place of the data values that vary from server to server. Configuration templates also contain instructions about how to recreate the configuration file from the template and from a value set during a push operation. The configuration template defines the fixed parts of the configuration file and the variable parts. The template also contains instructions to parse the configuration file and to recreate the configuration file to push it to managed servers.

You create configuration template files using the SA Configuration Modeling Language (CML) or in XML. Use XML for all XML-based configuration files and CML for all other configuration files. For complete information on CML, see CML Reference. For information on XML configuration files, see Managing XML configuration files.

You define the values that will be used to generate the final configuration file. These values are stored as value sets in the SA database. The CML or XML in the configuration template merges the values in a value set with the template file to generate the target configuration file. For more information, see Value sets.

You can also use the configuration template to import data from a configuration file and build a value set. For more information, see Import and validate a template file.

To manage configuration files, create a configuration template for each file you want to manage and add it to an Application Configuration. For more information, see test text .

CML configuration templates

The Configuration Modeling Language (CML) provides a way to create a template of a configuration file that is merged with a value set to generate an actual configuration file. The following figure shows a sample configuration template file in Configuration Modeling Language (CML).

For more information, see CML Tutorial 1 - Create an Application Configuration for a simple web app server, CML Tutorial 2 - Create a template of a web server configuration file and CML Reference.

Following is an example of a configuration template written in CML.

XML and XML-DTD configuration templates

You can also manage XML configuration files on your managed servers. Using XML configuration templates, you can model XML configuration file values, check those values against actual XML on target servers, and push changes to the target files. You can model XML configuration files that use a DTD as well as XML configuration files that do not.

An XML configuration template functions much like a CML template, but uses some application configuration options defined in the comments. With XML configuration templates, you can also use tags to customize the way the file is displayed in the SA Client.

For more information, see Managing XML configuration files.

Script templates

You can add scripts to an Application Configuration that are executed before or after the configuration values are copied to the target server. To include a script in an application configuration object you must copy the script into a CML template then import the script template into the application configuration object.

For more information, see Run scripts with Application Configurations and Create a template from a script.