Writing configuration files

This version is no longer supported, maintained, or updated. For current versions, see Puppet Enterprise support lifecycle.
Sections

We support two formats for configuration files that configure Puppet settings: valid JSON and HOCON (Human-Optimized Config Object Notation), a JSON superset. The included examples show the difference between JSON and HOCON.

Read more about HOCON (Human-Optimized Config Object Notation)

Brackets

In HOCON you can omit the { and } around a root object.

JSON example HOCON example
{
   "authorization": {
    	"version": 1
    }
}
"authorization": {
    "version": 1
}

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 HOCON
"authorization": {
    "version": 1
}
authorization: {
    version: 1
}

Commas

When writing a map or array in HOCON, you can use a new line instead of a comma.

JSON HOCON
Map
rbac: {
 password-reset-expiration: 24,
 session-timeout: 60,
 failed-attempts-lockout: 10,
}
rbac: {
 password-reset-expiration: 24
 session-timeout: 60
 failed-attempts-lockout: 10
}
Array
http-client: {
    ssl-protocols: [TLSv1, TLSv1.1, TLSv1.2]
}
http-client: {
    ssl-protocols: [
    TLSv1
    TLSv1.1
    TLSv1.2
    ]
}

Comments

Add comments using either // or #. Inline comments are supported.

HOCON
authorization: {
    version: 1
    rules: [
        {
            # Allow nodes to retrieve their own catalog
            match-request: {
                path: "^/puppet/v3/catalog/([^/]+)$"
                type: regex
                method: [get, post]
            }
        }
    ]
}
How helpful was this page?
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.