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. ;)
Regards,
Daniel
--
✉ Daniel Pittman <[email protected]>
⌨ [email protected] (XMPP)
☎ +1 503 893 2285
♻ made with 100 percent post-consumer electrons
--
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.