I''ve got a test erb template for tomcat''s server.xml that looks like: <% port_base = tomcat_port.to_i port_shutdown = tomcat_port.to_i + 1 port_connector = tomcat_port.to_i + 2 port_redir = tomcat_port.to_i + 3 port_ssl = tomcat_port.to_i + 4 %> <%= port_base %> This works just fine. When I put in a full-fledged server.xml (with the same lines at the start), I get debug: Calling puppetmaster.getconfig err: Could not retrieve catalog: Uncaught exception compile error (erb):254: syntax error HashMap map = (HashMap)session.getAttribute("map"); ^ in method puppetmaster.getconfig I''m guessing that the interpreter for the erb file is a bit ticked off about the XML, but I''m not sure. debug: Scope(Tomcat5_instance[tomcat-baf]): Retrieving template tomcat5/sysconfig.erb debug: template[/etc/puppet/modules/tomcat5/templates/sysconfig.erb]: Interpolated template /etc/puppet/modules/tomcat5/templates/sysconfig.erb in 0.01 seconds debug: Scope(Tomcat5_instance[tomcat-baf]): Retrieving template tomcat5/snmp.properties.erb debug: template[/etc/puppet/modules/tomcat5/templates/snmp.properties.erb]: Interpolated template /etc/puppet/modules/tomcat5/templates/snmp.properties.erb in 0.00 seconds debug: Scope(Tomcat5_instance[tomcat-baf]): Retrieving template tomcat5/tomcat-users.xml.erb debug: template[/etc/puppet/modules/tomcat5/templates/tomcat-users.xml.erb]: Interpolated template /etc/puppet/modules/tomcat5/templates/tomcat-users.xml.erb in 0.00 seconds debug: Scope(Tomcat5_instance[tomcat-baf]): Retrieving template tomcat5/server.xml.erb Pointers on how I can track this down? I need a deterministic version of the CentOS port-change stuff in the tomcat startup, and a template is the only way I''m aware I can do this. 0.24.4 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, Jun 25, 2008 at 11:00 AM, Duncan Hill <bajandude@googlemail.com> wrote:> > I''ve got a test erb template for tomcat''s server.xml that looks like: > <% > port_base = tomcat_port.to_i > port_shutdown = tomcat_port.to_i + 1 > port_connector = tomcat_port.to_i + 2 > port_redir = tomcat_port.to_i + 3 > port_ssl = tomcat_port.to_i + 4 > %> > > <%= port_base %> > > This works just fine. > > When I put in a full-fledged server.xml (with the same lines at the > start), I get > debug: Calling puppetmaster.getconfig > err: Could not retrieve catalog: Uncaught exception compile error > (erb):254: syntax error > HashMap map = (HashMap)session.getAttribute("map"); > ^ in method > puppetmaster.getconfig > > I''m guessing that the interpreter for the erb file is a bit ticked off > about the XML, but I''m not sure.<snip>> Pointers on how I can track this down? I need a deterministic version > of the CentOS port-change stuff in the tomcat startup, and a template > is the only way I''m aware I can do this. > > 0.24.4Try using erb -x -T ''-'' mytemplate.erb | ruby -c <TEMPLATE> . This will help you debug in thing in the template itself that may make ERB barf on it. I use this alot for debugging template syntax issues. It does not help much with any puppet centric template problems but will eliminate the template itself as a problem. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2008/6/25 Evan Hisey <ehisey@gmail.com>:> > On Wed, Jun 25, 2008 at 11:00 AM, Duncan Hill <bajandude@googlemail.com> wrote:>> When I put in a full-fledged server.xml (with the same lines at the >> start), I get >> debug: Calling puppetmaster.getconfig >> err: Could not retrieve catalog: Uncaught exception compile error >> (erb):254: syntax error >> HashMap map = (HashMap)session.getAttribute("map"); >> ^ in method >> puppetmaster.getconfig >> >> I''m guessing that the interpreter for the erb file is a bit ticked off >> about the XML, but I''m not sure. > > <snip> > >> Pointers on how I can track this down? I need a deterministic version >> of the CentOS port-change stuff in the tomcat startup, and a template >> is the only way I''m aware I can do this. >> >> 0.24.4 > Try using erb -x -T ''-'' mytemplate.erb | ruby -c <TEMPLATE> . ThisAh Hah! useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called. false means to replicate the session after each request. false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager) <% HashMap map = (HashMap)session.getAttribute("map"); map.put("key","value"); %> Ruby really doesn''t like that :) Fixed the syntax to not be rubyish and puppet is happy. Thanks Evan. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---