Ask Your Question
1

Ignore literal special characters in template

asked 2013-10-21 10:34:22 -0500

banjer gravatar image

I'm working on templatizing a postgres conf file that has a literal line like this

log_line_prefix = '<%u %%%d %%%t %r>'

that gets interpreted as ERB code because of the <%. A syntax check as well as a puppet agent -t run results in this error:

$ erb -P -x -T '-' postgresql.conf.erb | ruby -c
-:381: syntax error, unexpected tIDENTIFIER, expecting $end
; u %%%d %%%t %r>'

How can I escape or ignore these values in the template so they do not get interpreted as ruby/erb code?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-10-21 16:49:51 -0500

Ancillas gravatar image

Try adding a '%'

log_line_prefix = '<%%u %%%d %%%t %r>'
edit flag offensive delete link more

Comments

1

Yep, using`<%%` did the trick, thanks!

banjer gravatar imagebanjer ( 2013-10-22 05:27:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-10-21 10:34:22 -0500

Seen: 2,019 times

Last updated: Oct 21 '13