I just saw this, glad you got it worked out. In my experience that sort of behavior usually does have to do with resource ordering, when something fails on one the first run but succeeds on the second. It's usually because a dependency like that got created too late.
Rich On Thursday, March 27, 2014, Bogdan Mania <bogdan.ma...@peoplepost.com> wrote: > Ok, I sorted it out... I used your suggestion too, but the problem was > that on the first run puppet created the log folder after initiating the > service start. And having nowhere to write the log, the application failed > to launch. > > So I added require File["/var/log/java/java-app"] to the service > declaration and it worked perfectly. > > Thanks for the answers. > > On Thursday, March 27, 2014 11:01:02 AM UTC+2, Jose Luis Ledesma wrote: >> >> I think you should declare the require Jdk7::Install7['jdk1.7.0_51'] in >> the service. >> >> If it doesn't work, I would comment out the service and would try to run >> it manually. It doesn't seem a puppet problem. >> El 27/03/2014 09:09, "Bogdan Mania" <bogdan...@peoplepost.com> escribió: >> >>> Yes it does. But java gets installed first when executing the catalog >>> for the first time. In the Puppet dashboard it shows for the service >>> "ensure changed 'stopped' to 'running'". >>> >>> But the service is not running. If I trigger a second puppet run it >>> shows again the >>> >>> On Wednesday, March 26, 2014 6:50:36 PM UTC+2, Jose Luis Ledesma >>> wrote:"ensure changed 'stopped' to 'running'" message and this time is >>> actually running. >>> >>> The service requiere the java to be installed first? >>> El 26/03/2014 14:49, "Bogdan Mania" <bogdan...@peoplepost.com> escribió: >>> >>> Hi, >>> >>> I've created a module to manage a custom java application. It has it's >>> own SysV init script which is working perfectly. >>> >>> My issue is this: when a node pulls it's catalog from the master for the >>> first time, it doesn't also start the service. It starts the service >>> however on the second run. >>> This is the module's init.pp file: >>> >>> class java-app { >>> >>> $java_paths = ["/usr/local/java/", "/usr/local/java/java-app/", >>> "/var/log/java/", "/var/log/java/java-app/", "/etc/java/", >>> "/etc/java/java-app/",] >>> >>> jdk7::install7 { 'jdk1.7.0_51': >>> version => "7u51", >>> fullVersion => "jdk1.7.0_51", >>> x64 => true, >>> downloadDir => "/install", >>> } >>> >>> file { $java_paths: >>> ensure => directory, >>> owner => "ec2-user", >>> group => "ec2-user", >>> recurse => true, >>> } >>> >>> file { "/usr/local/java/java-app/java-app.jar": >>> ensure => present, >>> owner => "ec2-user", >>> group => "ec2-user", >>> notify => Service["java-app"], >>> source => "puppet:///files/java-app/java-app.jar", >>> } >>> >>> file { "/etc/java/java-app/java-app.yml": >>> ensure => present, >>> owner => "ec2-user", >>> group => "ec2-user", >>> notify => Service["java-app"], >>> source => "puppet:///files/java-app/java-app.yml", >>> } >>> >>> file { "/etc/init.d/java-app": >>> ensure => present, >>> source => "puppet:///files/java-app/java-app", >>> } >>> >>> service { "java-app": >>> ensure => running, >>> enable => true, >>> hasrestart => true, >>> hasstatus => true, >>> status => '/sbin/service java-app status | grep "is >>> running"', >>> restart => "/sbin/service java-app restart", >>> start => "/sbin/service java-app start", >>> stop => "/sbin/service java-app stop", >>> require => [ File['/etc/java/java-app/java-app.yml'], >>> File['/usr/local/java/java-app/java-app.jar'], >>> File['/etc/init.d/java-app'] ] >>> } >>> } >>> >>> -- >>> 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...@googlegroups.com. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/puppet-users/d707884b-4280-4905-8519-412c7eecb36b%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/d707884b-4280-4905-8519-412c7eecb36b%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to the Google Gro >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/puppet-users/cc548fed-244a-4610-aea5-d28417b18f65% >>> 40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/cc548fed-244a-4610-aea5-d28417b18f65%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > 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<javascript:_e(%7B%7D,'cvml','puppet-users%2bunsubscr...@googlegroups.com');> > . > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/2ee22927-2c03-4c79-bff2-dd9a4e0e25fd%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/2ee22927-2c03-4c79-bff2-dd9a4e0e25fd%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAPGcbtBt6V9ghn443wD54soJk7kiTRLRehXwxPD-h%3DCDq6iYTg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.