Try this:
class foo {
define set ( var1 = "line1
line2
line3" ){
file { "/tmp/foo":
content => template("foo.erb")
}
}
}
foo.erb:
<% var1.gsub!(/^(.*)$/,'' foo \1'' %><%= var1 %>
manifest:
foo { "test": }
Results:
Run 1 -->
foo line1
foo line2
foo line3
Run 2 -->
foo foo line1
foo foo line2
foo foo line3
Run 3 -->
foo foo foo line1
foo foo foo line2
foo foo foo line3
.... See the problem?!
Restart puppetmasterd
Run 1 -->
foo line1
foo line2
foo line3
Run 2 -->
foo foo line1
etc...
Should we not use variable modifying actions in the ERB files? Did I
miss some FAQ something again ;-)?
Workaround -- foo.erb:
<% lvar1 = var1.gsub(/^(.*)$/,'' foo \1'' %><%= lvar1
%>
Trevor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
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
-~----------~----~----~----~------~----~------~--~---