The service requiere the java to be installed first? El 26/03/2014 14:49, "Bogdan Mania" <bogdan.ma...@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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/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 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/CAF_B3deNCsP5dvvj%3DQpNSJbKLm5k0G%2B0SVxGY%2BMkKHK4cQgQDw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.