|
Banjer |
at Aug 31, 2012 at 5:40 pm
|
⇧ |
| |
Thanks for the reply KW, but thats not quite what I was asking. Heres the
relevant section of the template:
*.notice;news.none;cron.none @loghost:514
<% if @hostname == "foo" %>
# Provides UDP syslog reception
$ModLoad imudp.so
$UDPServerRun 514
<% end %>
So you can see it lives outside of a <% %> block.
This part: "*.notice;news.none;cron.none @loghost:514*" *should be a
literal string. Its a standard rsyslog configuration. "Loghost" is the
actual hostname of a host in our network that we send all of our servers'
syslogs to. In other words, I don't want it to be evaluated as ERB code.
So how can I have puppet/the template engine ignore the '@' symbol and
treat it as a literal string?
On Friday, August 31, 2012 11:21:08 AM UTC-4, Krzysztof Wilczynski wrote:Hi,
I am not sure how your template looks like, or how do you render it, but
try to avoid putting anything with @ into a <%= %> block. It should just
work:
matti@acrux ~ $ irb
=> true
=> "localhost"
p ERB.new('*.notice;news.none;cron.none @<%= host
%>:514').result(binding)
"*.notice;news.none;cron.none @localhost:514"
=> nil
=> "localhost"
p ERB.new('*.notice;news.none;cron.none @<%= @host
%>:514').result(binding)
"*.notice;news.none;cron.none @localhost:514"
=> nil
matti@acrux ~ $ cat | puppet apply --noop
notice inline_template('*.notice;news.none;cron.none @<%= @hostname
%>:514') notice: Scope(Class[main]):
*.notice;news.none;cron.none @acrux:514
notice: Finished catalog run in 0.03 seconds
matti@acrux ~ $
KW
On Friday, 31 August 2012 15:09:17 UTC+1, banjer wrote:
Hi,
I have a template named rsyslog.conf.erb, and the puppet agents seem to
be choking on this:
**.notice;news.none;cron.none @loghost:514*
The agents report an error of ": bad URI(is not URI?): " followed by a
bunch of jargon. I'm pretty sure its the literal '@' symbol that its
trying to evaluate as erb code. How can I escape this @ symbol so its a
literal? Thanks.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/8e0XGAVVVeIJ.To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.