/puppet-evaluator

Puppet Evaluator written in the Go language

Primary LanguageGoApache License 2.0Apache-2.0

Puppet Evaluator

This is an evaluator for the AST produced by the Puppet Language Parser

Unit Testing

Tests for virtually everything is written in the Puppet Specification Language and can be found in the Puppet Spec project under the eval_tests/testdata directory.

Implementation status

Expression evaluator:

  • literal expressions
  • variable assignment
  • + operator
  • - operator (binary)
  • - operator (unary)
  • * operator (binary)
  • * operator (unary)
  • / operator
  • % operator
  • << operator
  • >> operator
  • logical and
  • logical or
  • logical not
  • == operator
  • != operator
  • =~ operator
  • !~ operator
  • < operator
  • <= operator
  • > operator
  • >= operator
  • in operator
  • if expressions
  • unless expressions
  • selector expressions
  • case expressions
  • method call expressions
  • function call expressions
  • lambdas
  • break statements
  • return statements
  • next statements
  • access expressions
  • global scope
  • local scope
  • node scope
  • string interpolation
  • Puppet type aliases
  • custom functions written in Puppet
  • custom functions written in Go
  • custom data types written in Puppet
  • custom data types written in Go
  • external data binding (i.e. hiera)
  • loading functions, plans, data types, and tasks from environment
  • loading functions, plans, data types, and tasks from module
  • ruby regexp (using Oniguruma)
  • type mismatch describer

Catalog and Resource related:

  • -> operator
  • ~> operator
  • <- operator
  • <~ operator
  • class definition statements
  • defined type statements
  • node definition statements
  • resource expressions
  • resource metaparameters
  • virtual resource expressions
  • exported resource expressions
  • resource defaults expressions
  • resource override expressions
  • resource collection statements
  • exported resource collection expressions (NYI: importing resources)

Data Type system:

  • Any

  • Array

  • Binary

  • Boolean

  • Callable

  • Collection

  • Data

  • Default

  • Enum

  • Error

  • Float

  • Hash

  • Init

  • Integer

  • Iterable

  • Iterator

  • NotUndef

  • Numeric

  • Optional

  • Object

  • Pattern

  • Regexp

  • Runtime

  • ScalarData

  • Scalar

  • SemVer

  • SemVerRange

  • Sensitive

  • String

  • Struct

  • Target

  • Task

  • Timespan

  • Timestamp

  • Tuple

  • Type

  • TypeSet

  • Unit

  • Undef

  • URI

  • Variant

  • CatalogEntry

  • Class

  • Resource

Puppet functions:

  • alert
  • all
  • annotate
  • any
  • assert_type
  • binary_file
  • break
  • call
  • crit
  • convert_to
  • debug
  • dig
  • each
  • emerg
  • epp
  • err
  • eyaml_data
  • fail
  • filter
  • find_file
  • hocon_data
  • info
  • inline_epp
  • json_data
  • lest
  • lookup
  • map
  • match
  • new
  • next
  • notice
  • reduce
  • regsubst
  • return
  • reverse_each
  • scanf
  • slice
  • split
  • step
  • sprintf
  • strftime
  • then
  • tree_each
  • type
  • unique
  • unwrap
  • versioncmp
  • warning
  • with
  • yaml_data

Catalog and Resource related:

  • contain
  • defined
  • include
  • require

Concepts

  • Settings
  • String formatting
  • File based loader hierarchies
  • Issue based error reporting
  • Logging
  • Facts as global variables
  • Pcore serialization
  • Pcore RichData <-> Data transformation
  • Remote calls to other language runtimes
  • Hiera 5
  • Automatic Parameter Lookup
  • CLI
  • Puppet PAL
  • Catalog production