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/53524FD1.4020200%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to