The two main kinds of error you're likely to encounter when running Puppet are compilation errors—errors in the manifest itself, or in template files—and errors from commands executed by Puppet when applying the manifest. We'll look at these in turn.
If you make a typo in the manifest, or
some other kind of error, Puppet will usually alert you when you run puppet apply
(or puppet parser validate
). It will tell you:
What the error was
What source file, and line number, the error occurred in
Let's take an example. If we apply a manifest containing a deliberate typo, like this (can you spot it?):
file { '/tmp/test': contents => 'Hello, world' }
Puppet will complain with an error message:
ubuntu@demo:~/puppet$ papply Error: Invalid parameter contents at /home/ubuntu/puppet/manifests/nodes.pp:4 on node demo.compute-1.internal
We actually should have said content
, not contents
, and Puppet is quite helpful about pointing out exactly where the problem is...