I'm writing ldirectord.cf files via puppet and unfortunately ldirectord is sensitive to blank lines in the file. I have the following code in my .erb file
virtual=<%= vip %>:<%= port %> <% if weights.empty? then -%><% real_servers.each do |real_server| -%> real=<%= real_server %>:<%= port %> gate <% end -%><% else -%><% real_servers.zip(weights).each do | real_server, weight| -%> real=<%= real_server %>:<%= port %> gate <%= weight %> <% end -%><% end -%> <% if not checktype.empty? then -%> checktype=<%= checktype -%><% end -%> <% if not service.empty? then -%> service=<%= service %><% end - %> <% if not checkcommand.empty? then -%> checkcommand=<%= checkcommand %><% end -%> protocol=<%= protocol %> scheduler=<%= scheduler %> persistent=<%= persistent %> This all works fine. If (say) checktype == 'fred' then I get a line checktype=fred My problem is that is checktype == '', the checktype = line isnt' printed (correct) but I get a blank line instead. e.g. virtual=192.168.1.1:53 real=192.168.1.2:53 gate real=192.168.1.3:53 gate protocol=udp scheduler=rr persistent=300 How can I stop those blank lines from appearing? Thanks Arthur -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.