Thanks Jakov! I do have a few custom facts that I'm using, but like you said, I'd need to run puppet twice. I wonder if I should test for the existence of a known file particular to the version of the package? Seems a bit hacky, but it's just a thought.
Thanks, Ale On Saturday, April 19, 2014 6:28:33 AM UTC-4, Jakov Sosic wrote: > > On 04/19/2014 04:09 AM, Alexander Gray II wrote: > > Is there a way in puppet to detect what version of python or ruby, or > > for that matter, any package which is installed? > > > > For instance: > > if python_version > x: > > do something > > else > > do something else > > > > It looks liek versioncmp is what I want, but I don't know how to get the > > version. > > Maybe do some sort of exec that gets this version? > > > > Sorry if this a newb question, > > You could write a custom fact, that would get you version number. > > One problem with that is the first puppet run, before the package is > installed, that fact would have to return something like '0', or 'nil', > so you would have to run puppet twice to get a node to a desired state. > > I haven't found more intelligent approach to this problem so far :-/ > > -- 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/35e5fb11-8179-49d7-9848-017997ebee55%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
