August 2015
Intermediate to advanced
144 pages
2h 58m
English
ERB templates are written in Ruby. The current releases of Puppet also support EPP Puppet templates, which are written in Puppet. The debugging of ERB templates can be done by running the templates through Ruby. To simply check the syntax, use the following code:
$ erb -P -x -T '-' template.erb |ruby -c Syntax OK
If your template does not pass the preceding test, then you know that your syntax is incorrect. The usual error type that you will see is as follows:
-:8: syntax error, unexpected end-of-input, expecting keyword_end
The problem with the preceding command is that the line number is in the evaluated code that is returned by the erb script, not the original file. When checking for the syntax error, you will have to inspect the ...
Read now
Unlock full access