Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.74 KB

con_template-writing-reference.adoc

File metadata and controls

27 lines (19 loc) · 1.74 KB

Template Writing Reference

Embedded Ruby (ERB) is a tool for generating text files based on templates that combine plain text with Ruby code. {ProjectName} uses ERB syntax in the following cases:

Provisioning templates

For more information, see {ProvisioningDocURL}creating-provisioning-templates_provisioning[Creating Provisioning Templates] in {ProvisioningDocTitle}.

Remote execution job templates

For more information, see [Configuring_and_Setting_Up_Remote_Jobs_{context}].

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_provisioning[Creating Partition Tables] 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}.

This section provides an overview of {Project}-specific macros and variables that can be used in ERB templates along with some usage examples. 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.

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.