Software Engineer

puppet syntax checks

· by jsnby · Read in about 1 min · (114 Words)
Puppet

I added a couple of syntax check aliases (well, one’s actually a function because alias didn’t seem to like putting a pipe in there) to my .bashrc file:

alias synpp='puppet --parseonly --ignoreimport'
synerb () {
    erb -x -T - "$@" | ruby -c
}

To check a .pp (manifest) file, I simply type synpp path/to/manifest.pp and to check a template synerb path/to/template.erb

This assumes that you have a puppet client installed on your local machine.

I realize that it would be more useful/powerful to put these checks into a pre-commit script for svn or other source control, but in my current environment, I don’t administrate the source control server, so I’ll just settle for doing it this way for now.