Hi Guys I am new to puppet and ruby. I am working on some erb template for ldap.
Following is sample code <% if TCPSocket.new("host1", 636) and TCPSocket.new("host2", 636) %> host xxxx port 636 tls_checkpeer yes <% else -%> host yyyy port 389 tls_checkpeer no <% end %> Above works if 636 is open but if its not then it never goes to else but raise exception of connection refused and eventually puppet fails. I tried catching exception in erb template but it didnt work. Possible to catch exceptions like below ? I want to exit it if any exception is raised. rescue Errno:: ECONNREFUSED => e Thanks for help -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/78410ff1-a123-4d02-bc6c-6afed211dd3a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.