I've used something like this:

Facter.add(:zabbix_version) do
  setcode do
    output = %x{/bin/rpm -qa --queryformat "%{VERSION}" zabbix-agent}
  end
end

But rpm queries can be expensive.

On Sun, Apr 29, 2012 at 2:42 AM, Peter Foley <[email protected]> wrote:

> Hi List,
>
> Is there a puppet command to find out what modules are available for use
> or at least a module to return a boolean value if you pass it a module name
> you wish to use?
>
> I am looking to do something like:
>
> if is_module_available(stdlib) {
>   # Use stdlib capability
> }
> else {
>   # Use my own version
> }
>
> Thanks,
>
> Peter
>
> --
> 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.
>

-- 
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.

Reply via email to