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" <[email protected]> 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" <[email protected]> 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 [email protected].
>>> 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 [email protected].
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF_B3dfnXsFtHQoguNf9Rxve7ni03f9%3DmZcg0tmaTpNG66_mLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to