Closed sknolin closed 7 years ago
I noticed the same, but this can be fixed in the erb syntax checker. This is what I use:
erb -P -x -T '-' $file | ruby -c
-P ignore lines which start with "%"
The output now becomes:
$ erb -P -x -T '-' users_groups.erb
#coding:ASCII-8BIT
_erbout = ''; _erbout.concat "# This file is managed by Puppet. All changes will be reverted\n# on the next Puppet run. Avoid making changes here.\n"
@users.each do |user|
_erbout.concat(( user ).to_s); _erbout.concat " ALL=(ALL) ALL\n"
; end
@groups.each do |group|
_erbout.concat "%"; _erbout.concat(( group ).to_s); _erbout.concat " ALL=(ALL) ALL\n"
; end
_erbout.force_encoding(__ENCODING__)
Looks perfectly correct?
We have pre-receive hooks that check erb syntax, and the % for sudo groups breaks that parser. %% escapes it