Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

puppet-parser (8)

Name

puppet-parser - Interact directly with the parser.

Synopsis

puppet parser action

Description

PUPPET-PARSER(8)                 Puppet manual                PUPPET-PARSER(8)



NAME
       puppet-parser - Interact directly with the parser.

SYNOPSIS
       puppet parser action

OPTIONS
       Note  that any setting that's valid in the configuration file is also a
       valid long argument, although it may or may  not  be  relevant  to  the
       present action. For example, server and run_mode are valid settings, so
       you can specify --server <servername>, or --run_mode  <runmode>  as  an
       argument.

       See   the  configuration  file  documentation  at  https://docs.puppet-
       labs.com/puppet/latest/reference/configuration.html for the  full  list
       of acceptable parameters. A commented list of all configuration options
       can also be generated by running puppet with --genconfig.

       --render-as FORMAT
              The format in which to render output. The  most  common  formats
              are  json, s (string), yaml, and console, but other options such
              as dot are sometimes available.

       --verbose
              Whether to log verbosely.

       --debug
              Whether to log debug information.

ACTIONS
       o   dump - Outputs a dump of the internal  parse  tree  for  debugging:
           SYNOPSIS

           puppet  parser  dump  [--e source] [--[no-]validate] [--format old,
           pn, or json] [--pretty]  [--format  old|pn|json]  [--pretty]  {  -e
           source | [templates ...] }

           DESCRIPTION

           This action parses and validates the Puppet DSL syntax without com-
           piling a catalog or syncing any resources.

           The output format can be controlled using the --format  old|pn|json
           where:

       o   'old' is the default, but now deprecated format which is not API.

       o   'pn' is the Puppet Extended S-Expression Notation.

       o   'json' outputs the same graph as 'pn' but with JSON syntax.



       The  output  will be "pretty printed" when the option --pretty is given
       together with --format 'pn' or 'json'. This option has no effect on the
       'old' format.

       The  command  accepts  one or more manifests (.pp) files, or an -e fol-
       lowed by the puppet source text. If no arguments are given,  the  stdin
       is read (unless it is attached to a terminal)

       The output format of the dumped tree is intended for debugging purposes
       and is not API, it may change from time to time.

       OPTIONS --e <source> - dump one source expression given on the  command
       line.

       --format  <old, pn, or json> - Get result in 'old' (deprecated format),
       'pn' (new format), or 'json' (new format in JSON).

       --pretty - Pretty print output. Only applicable together with  --format
       pn or json

       --[no-]validate  -  Whether  or  not  to validate the parsed result, if
       no-validate only syntax errors are reported

       RETURNS

       A dump of the resulting AST model unless there are syntax or validation
       errors.

       o   validate  -  Validate  the syntax of one or more Puppet manifests.:
           SYNOPSIS

           puppet parser validate [manifest] [manifest ...]

           DESCRIPTION

           This action validates Puppet DSL syntax without compiling a catalog
           or  syncing  any  resources.  If no manifest files are provided, it
           will validate the default site manifest.

           When validating multiple issues per file are  reported  up  to  the
           settings of max_error, and max_warnings. The processing stops after
           having reported issues for the first encountered file with errors.

           RETURNS

           Nothing, or the first syntax error encountered.



EXAMPLES
       validate

       Validate the  default  site  manifest  at  /etc/puppetlabs/puppet/mani-
       fests/site.pp:

       $ puppet parser validate

       Validate two arbitrary manifest files:

       $ puppet parser validate init.pp vhost.pp

       Validate from STDIN:

       $ cat init.pp | puppet parser validate

COPYRIGHT AND LICENSE
       Copyright 2014 by Puppet Inc. Apache 2 license; see COPYING



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+--------------------------+
       |ATTRIBUTE TYPE |     ATTRIBUTE VALUE      |
       +---------------+--------------------------+
       |Availability   | system/management/puppet |
       +---------------+--------------------------+
       |Stability      | Volatile                 |
       +---------------+--------------------------+
NOTES
       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source  was  downloaded  from  https://github.com/puppetlabs/puppet/ar-
       chive/5.5.0.tar.gz

       Further information about this software can be found on the open source
       community website at http://puppetlabs.com/.



Puppet, Inc.                      March 2018                  PUPPET-PARSER(8)