Create a custom fact for the java version installed. There are some
suggestions here
https://groups.google.com/forum/#!topic/puppet-users/W67dvqS-GdU
then you do something like the following:
$new_version = versioncmp($::java_version, '1.5.0.3') ? {
1 => '1.7.1',
default => $::java_version
}
package { 'jdk':
ensure => $new_version
}
note that this is not tested ;)
--
Nikola
On Tue, Mar 11, 2014 at 09:01:46PM -0400, [email protected] wrote:
> I looked at versioncmp example available out of box.
>
>
> It is like strcmp.
> I have a need to write a manifest to check for the existence of java version.
> If it is 1.5.0.3 or less, upgrade to 1.7.1. This should be done on 10 nodes.
>
>
> Appreciate any example to accomplish this task. thanks
>
> --
> 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/8D10BA5C66CB3D1-318-35AA7%40webmail-m260.sysops.aol.com.
> 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/20140321091147.GB3582%40nikolavp-desktop.
For more options, visit https://groups.google.com/d/optout.