michal ruzicka
2010-Dec-20 20:00 UTC
[Puppet Users] How to ensure at least one of possibly many prerequisites is installed?
Hi All, I would like to use puppet to install a tool which requires java on a linux machine. I could do that quite easily by depending on a specific java package (say OpenJDK), then I would simply do: package { "java-1.6.0-openjdk": ensure => installed } ... { require => Package["java-1.6.0-openjdk"] } But as the tool is pretty basic and can be run with just about any java 1.5 implementation around, I would prefer not to install the OpenJDK if there is already any other java 1.5 (even gcj) installed on the target machine. What would be the best approach to achieve that with puppet? I should add that I''m quite new to puppet, so please bear with me if the solution is obvious ... Thanks, Michal -- 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.
Ohad Levy
2010-Dec-20 20:28 UTC
Re: [Puppet Users] How to ensure at least one of possibly many prerequisites is installed?
add a fact which checks if java is installed? Ohad On Mon, Dec 20, 2010 at 10:00 PM, michal ruzicka <michal.ruza@gmail.com>wrote:> Hi All, > I would like to use puppet to install a tool which requires java on a > linux machine. I could do that quite easily by depending on a specific > java package (say OpenJDK), then I would simply do: > > package { "java-1.6.0-openjdk": > ensure => installed > } > > ... { > require => Package["java-1.6.0-openjdk"] > } > > But as the tool is pretty basic and can be run with just about any > java 1.5 implementation around, I would prefer not to install the > OpenJDK if there is already any other java 1.5 (even gcj) installed on > the target machine. > > What would be the best approach to achieve that with puppet? > > I should add that I''m quite new to puppet, so please bear with me if > the solution is obvious ... > > Thanks, > Michal > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- 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.
michal ruzicka
2010-Dec-23 20:10 UTC
[Puppet Users] Re: How to ensure at least one of possibly many prerequisites is installed?
Yes, I was able to solve it by adding a custom fact. Thanks for the tip! Michal On Dec 20, 9:28 pm, Ohad Levy <ohadl...@gmail.com> wrote:> add a fact which checks if java is installed? > > Ohad > > On Mon, Dec 20, 2010 at 10:00 PM, michal ruzicka <michal.r...@gmail.com>wrote: > > > Hi All, > > I would like to use puppet to install a tool which requires java on a > > linux machine. I could do that quite easily by depending on a specific > > java package (say OpenJDK), then I would simply do: > > > package { "java-1.6.0-openjdk": > > ensure => installed > > } > > > ... { > > require => Package["java-1.6.0-openjdk"] > > } > > > But as the tool is pretty basic and can be run with just about any > > java 1.5 implementation around, I would prefer not to install the > > OpenJDK if there is already any other java 1.5 (even gcj) installed on > > the target machine. > > > What would be the best approach to achieve that with puppet? > > > I should add that I''m quite new to puppet, so please bear with me if > > the solution is obvious ... > > > Thanks, > > Michal > > > -- > > 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<puppet-users%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/puppet-users?hl=en.-- 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.