Last Updated: February 25, 2016
·
14.55K
· mcappadonna

Validate puppet code and erb templates

Before commit on your favorites versioning server, you MUST check for common syntax error on your puppet code (.pp files) and on your puppet template (.erb files).

You can do easly by launching this commands on your modified files:

# puppet parser validate manifests/changedcode.pp

and

# erb -x -T '-' templates/changedtemplate.erb | ruby -c

You must launch those commands from your module directory.

In the next days I'll show you a way to automatize this operations before the commit.