Write a simple manifest
Puppet manifest files are lists of resources that have a unique title and a set of named attributes that describe the desired state.
You need a text editor, for example Visual Studio Code (VS Code), to create manifest files. Puppet has an extension for VS Code that supports syntax highlighting of the Puppet language. Editors like Notepad++ or Notepad won't highlight Puppet syntax, but can also be used to create manifests.
Manifest files are written in Puppet code, a domain specific language (DSL) that defines the desired state of resources on a system, such as files, users, and packages. Puppet compiles these text-based manifests into catalogs, and uses those to apply configuration changes.
Note the following details in this file resource example:
-
Puppet uses a basic syntax of
type { title: }
, wheretype
is the resource type — in this case it’sfile
. -
The resource title (the value before the
:
) isC:\\Temp\\foo.txt
. The file resource uses the title to determine where to create the file on disk. A resource title must always be unique within a given manifest. -
The
ensure
parameter is set topresent
to create the file on disk, if it's not already present. Forfile
type resources, you can also use the valueabsent
, which removes the file from disk if it exists. -
The
content
parameter is set toThis is some text in my file
, which writes that value to the file.