How do I check for deprecated variable references in templates?
Suppose I have a template referencing a fact like this (deprecated):
mysetting=myval listen=<%= ipaddress %>
Then this will generate a warning in the Puppet master log:
Variable access via 'ipaddress' is deprecated. Use '@ipaddress' instead. template[/path/to/template.erb]:2
Fine, I know where to fix this now. However, it does not parse all manifests/templates, but only for a given node. I need to verify all templates, preferably offline without the need to run the agent everywhere.
From the Puppet documentation I can check for valid syntax using
erb -P -x -T '-' mytemplate.erb | ruby -c
However, it does not spot the error then:
erb -x -T '-' /path/to/template.erb | ruby -c Syntax OK
How can I check this "offline" reliably?