1. Check the syntax:
Run the `puppet parser validate` command to check for syntax errors.

2. Check the logs:
Check the Puppet Agent log files located in `/var/log/puppetlabs/puppet/` for errors.

3. Debug with the `–debug` flag:
Run the `puppet apply –debug` command to show debugging information.

4. Debug with the `–trace` flag:
Run the `puppet apply –trace` command to show debugging information including the stack trace.

5. Debug with the `–test` flag:
Run the `puppet apply –test` command to show debugging information and test the manifest without making any changes.

Example:

$ puppet parser validate /etc/puppet/manifests/site.pp
Syntax OK

$ puppet apply –debug /etc/puppet/manifests/site.pp
Debug: Runtime environment: puppet_version=4.10.12, ruby_version=2.4.4, run_mode=user, default_encoding=UTF-8
Debug: Loading facts
Debug: Loading library ‘puppet/parser/functions/hiera’
Debug: Loading library ‘puppet/parser/functions/include’
Debug: Loading library ‘puppet/parser/functions/concat’
Debug: Loading library ‘puppet/parser/functions/strftime’
Debug: Loading library ‘puppet/parser/functions/file’
Debug: Loading library ‘puppet/parser/functions/inline_template’
Debug: Loading library ‘puppet/parser/functions/generate’
Debug: Loading library ‘puppet/parser/functions/assert_type’
Debug: Loading library ‘puppet/parser/functions/lookup’
Debug: Loading library ‘puppet/parser/functions/each’
Debug: Loading library ‘puppet/parser/functions/template’
Debug: Loading library ‘puppet/parser/functions/with’
Debug: Loading library ‘puppet/parser/functions/dig’
Debug: Loading library ‘puppet/parser/functions/assert_private’
Debug: Loading library ‘puppet/parser/functions/inline_epp’
Debug: Loading library ‘puppet/parser/functions/create_resources’
Debug: Loading library ‘puppet/parser/functions/slice’
Debug: Loading library ‘puppet/parser/functions/assert_structured_data’
Debug: Loading library ‘puppet/parser/functions/each_host_of’
Debug: Loading library ‘puppet/parser/functions/each_key_of’
Debug: Loading library ‘puppet/parser/functions/reduce’
Debug: Loading library ‘puppet/parser/functions/assert_string’
Debug: Loading library ‘puppet/parser/functions/assert_numeric’
Debug: Loading library ‘puppet/parser/functions/assert_boolean’
Debug: Loading library ‘puppet/parser/functions/assert_array’
Debug: Loading library ‘puppet/parser/functions/assert_hash’
Debug: Loading library ‘puppet/parser/functions/assert_scalar’
Debug: Loading library ‘puppet/parser/functions/assert_integer’
Debug: Loading library ‘puppet/parser/functions/assert_regex’
Debug: Loading library ‘puppet/parser/functions/assert_undef’
Debug: Loading library ‘puppet/parser/functions/assert_resource’
Debug: Loading library ‘puppet/parser/functions/each_value_of’
Debug: Loading library ‘puppet/parser/functions/assert_type_or_undef’
Debug: Loading library ‘puppet/parser/functions/assert_key_value’
Debug: Loading library ‘puppet/parser/functions/assert_key’
Debug: Loading library ‘puppet/parser/functions/assert_absolute_path’
Debug: Loading library ‘puppet/parser/functions/assert_sensitive’
Debug: Loading library ‘puppet/parser/functions/assert_non_empty’
Debug: Loading library ‘puppet/parser/functions/assert_optional’
Debug: Loading library ‘puppet/parser/functions/assert_not_empty’
Debug: Loading library ‘puppet/parser/functions/assert_not_undef’

Leave a Reply

Your email address will not be published. Required fields are marked *