Writing configuration files
Puppet supports two formats for configuration files that configure settings: valid JSON and Human-Optimized Config Object Notation (HOCON), a JSON superset.
For more information about HOCON itself, see the HOCON documentation.
Configuration file syntax
Refer to these examples when you're writing configuration files to identify correct JSON or HOCON syntax.
Brackets
In HOCON, you can omit the brackets ( { }
) around a root object.
JSON example | HOCON example |
---|---|
|
|
Quotes
In HOCON, double quotes around key and value strings are optional
in most cases. However, double quotes are required if the string contains the
characters *
, ^
, +
, :
, or =
.
JSON example | HOCON example |
---|---|
|
|
Commas
When writing a map or array in HOCON, you can use a new line
instead of a comma.
JSON example | HOCON example | |
---|---|---|
Map |
|
|
Array |
|
|
Comments
Add comments using either
//
or #
. Inline
comments are supported. HOCON example |
---|
|