Embedded Ruby (ERB) is a tool for generating text files based on templates that combine plain text with Ruby code. You can use the following {Project}-specific macros and variables in your ERB templates.
When provisioning a host or running a remote job, the code in the ERB is executed and the variables are replaced with the host specific values. This process is referred to as rendering. {ProjectServer} has the safemode rendering option enabled by default, which prevents any harmful code being executed from templates.
Note that the default templates provided by {ProjectName} (Hosts > Templates > Provisioning Templates, Hosts > Templates > Job templates, Monitor > Reports > Report Templates ) also provide a good source of ERB syntax examples.
{ProjectName} uses ERB syntax in the following cases:
- Provisioning templates
-
For more information, see {ProvisioningDocURL}creating-provisioning-templates-by-using-web-ui[Creating provisioning templates in {ProjectWebUI}] in {ProvisioningDocTitle}.
- Remote execution job templates
-
For more information, see [configuring-and-setting-up-remote-jobs].
- Report templates
-
For more information, see [Using_Report_Templates_to_Monitor_Hosts_{context}].
- Templates for partition tables
-
For more information, see {ProvisioningDocURL}creating-partition-tables-by-using-web-ui[Creating partition tables by using {ProjectWebUI}] in {ProvisioningDocTitle}.
- Smart Class Parameters
-
For more information, see {ManagingConfigurationsPuppetDocURL}Configuring_Puppet_Smart_Class_Parameters_managing-configurations-puppet[Configuring Puppet smart class parameters] in {ManagingConfigurationsPuppetDocTitle}.