On Thu, Jan 6, 2011 at 5:55 PM, Daniel Pittman <[email protected]> wrote:
> On Thu, Jan 6, 2011 at 09:24, Martin Harrigan <[email protected]> > wrote: > > > I install the latest version of a Ruby gem using: > > > > package { 'passenger': ensure => latest, provider => 'gem' } > > > > However, I want to retrieve the actual version number for further > > configuration. Is this possible? > > Not inside the puppet catalog in a client/server situation: the > catalog is fully and completely compiled on the server, sent to the > client, and then executed - at which point any passenger upgrade would > happen. > > > I don't think I can use a custom fact since it may be evaluated on the > > client before the gem is installed. Is there something like > > Package['passenger'].version? > > Your two choices I can see at this stage are: > > 1. Use an 'exec' or something like that which evaluates on the client, > and ensure that it depends on the package action so that is completed > first. That can then react, and a 'refreshonly' exec will trigger > only when the upgrade happened. > > 2. Use a custom fact, and accept that you have two run puppet twice > for things to converge on your machines. > > If you tell us *why* you need to know the version number, though, we > might be able to suggest the super-clever and much nicer option number > 3 for you. ;) > After installing Passenger, I install nginx. I use the template below for an nginx configuration file: ... http { passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-<%= passenger_version %>; ... } ... My problem is the passenger_version variable. I need to know the version of Passenger that was installed in the previous step. Thank you for your suggestions; I will try something like (1). Martin. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
