Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 1.02 KB

File metadata and controls

20 lines (17 loc) · 1.02 KB

Generic {Project}-specific macros

You can use {Project}-specific macros in your ERB templates to generate URLs, indent code, and reuse common patterns across templates.

Table 1. Generic macros
Name Description

indent(n)

Indents the block of code by n spaces, useful when using a snippet template that is not indented.

foreman_url(kind)

Returns the full URL to host-rendered templates of the given kind. For example, templates of the "provision" type usually reside at http://{foreman-example-com}/unattended/provision.

snippet(name)

Renders the specified snippet template. Useful for nesting provisioning templates.

snippets(file)

Renders the specified snippet found in the Foreman database, attempts to load it from the unattended/snippets/ directory if it is not found in the database.

snippet_if_exists(name)

Renders the specified snippet, skips if no snippet with the specified name is found.