Reserved names and allowed characters
As with every language, Puppet DSL has some restrictions on the names we can give to its elements and the allowed characters.
As a general rule, for names of resources, variables, parameters, classes, and modules we can use only lowercase letters, numbers, and the underscore (_). Usage of hyphens (-) should be avoided (in some cases it is forbidden; in others it depends on Puppet's version).
We can use uppercase letters in variables names (but not at their beginning) and any character for resources' titles.
Names are case sensitive, and there are some reserved words that cannot be used as names for resources, classes, or defines or as unquoted word strings in the code, such as:
and
, case
, class
, default
, define
, else
, elsif
, false
, if
, in
, import
, inherits
, node
, or
, true
, undef
, unless
, main
, settings
, $string
.
A fully updated list of reserved words can be found here: https://docs.puppet.com/puppet/latest/reference/lang_reserved.html