Hi! I''m a newbie in Puppet with some Chef experience. Now trying to convert my pet project from Chef to Puppet. When I start a Tomcat is takes some time (several seconds). I need to wait a line "Server startup in" in Tomcat''s log before proceeding. Here is a way which I used in Chef: https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb And include following in your recipe: tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" do pattern "Server startup in" timeout 60 action :watch_for_line end What is an easy way to do the same in Puppet world? Andrey. -- 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/-/WtW6gPXF42oJ. 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 Monday, January 21, 2013 3:32:51 PM UTC-6, Andrey Brindeyev wrote:> > Hi! > > I''m a newbie in Puppet with some Chef experience. > > Now trying to convert my pet project from Chef to Puppet. > > When I start a Tomcat is takes some time (several seconds). > > I need to wait a line "Server startup in" in Tomcat''s log before > proceeding. > > Here is a way which I used in Chef: > > > https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb > > And include following in your recipe: > > tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" do > pattern "Server startup in" > timeout 60 > action :watch_for_line > end > > > What is an easy way to do the same in Puppet world? > >There isn''t, really. Puppet is more about the state a node should be in, not so much the exact order the steps need to be done in. Puppet and Chef, while having the same end goals, are use two very different approaches. If you can better describe what it is you are trying to accomplish, we can more than likely help you find the best way to do that.> Andrey. >-- 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/-/z1B7xdLhBJ8J. 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.
Andrey Brindeyev
2013-Jan-21 22:28 UTC
[Puppet Users] Re: How to watch a logfile in Puppet?
I need to deploy Java artifact to Tomcat and run tests. Due Java environment variables change I can''t just put WAR file inside Tomcat, entire Tomcat app needs to be restarted. If I start my tests immediately after Tomcat startup then they fail due "Connection refused" error. I need to wait until Tomcat service start and initializes itself and all deployed artifacts. Easiest way to do that is to wait specified pattern in Tomcat''s log file. Andrey. On Monday, January 21, 2013 2:04:24 PM UTC-8, llowder wrote:> > > > On Monday, January 21, 2013 3:32:51 PM UTC-6, Andrey Brindeyev wrote: >> >> Hi! >> >> I''m a newbie in Puppet with some Chef experience. >> >> Now trying to convert my pet project from Chef to Puppet. >> >> When I start a Tomcat is takes some time (several seconds). >> >> I need to wait a line "Server startup in" in Tomcat''s log before >> proceeding. >> >> Here is a way which I used in Chef: >> >> >> https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb >> >> And include following in your recipe: >> >> tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" do >> pattern "Server startup in" >> timeout 60 >> action :watch_for_line >> end >> >> >> What is an easy way to do the same in Puppet world? >> >> > There isn''t, really. Puppet is more about the state a node should be in, > not so much the exact order the steps need to be done in. Puppet and Chef, > while having the same end goals, are use two very different approaches. > > If you can better describe what it is you are trying to accomplish, we can > more than likely help you find the best way to do that. > > >> Andrey. >> >-- 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/-/lsxSq_kvaK4J. 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 Mon, Jan 21, 2013 at 4:28 PM, Andrey Brindeyev < abrindeyev@griddynamics.com> wrote:> I need to deploy Java artifact to Tomcat and run tests. > Due Java environment variables change I can''t just put WAR file inside > Tomcat, entire Tomcat app needs to be restarted. > > If I start my tests immediately after Tomcat startup then they fail due > "Connection refused" error. > I need to wait until Tomcat service start and initializes itself and all > deployed artifacts. Easiest way to do that is to wait specified pattern in > Tomcat''s log file. >Just write and deploy the service startup wrapper script and ask puppet to invoke that script for service start. service { ''tomcat'': ensure => running, start => custom_startup_script. } The custom startup script should just do the same thing as the chef script, start the service, watch the log before exit, or timeout and fail. Nan -- 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.