FAQ
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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Len Rugen at Apr 29, 2012 at 8:00 pm
    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 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 puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@googlegroups.com.
    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 puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter at Apr 30, 2012 at 11:57 am
    Hi Len,

    Thanks for the reply, sorry I should have been a bit clearer I
    actually meant puppet modules.

    Ie I want to be able to establish if a puppet module is installed in
    the one of the modulepath locations

    root@core modules/puppet# puppet config print modulepath
    /etc/puppet/modules:/usr/share/puppet/modules

    I guess I could go down a similar path and write a fact to query the
    module directories and then query against this. Any other
    suggestions?

    Thanks,

    Peter
    On Apr 30, 6:00 am, Len Rugen wrote:
    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.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedApr 29, '12 at 7:42a
activeApr 30, '12 at 11:57a
posts3
users2
websitepuppetlabs.com

2 users in discussion

Peter: 2 posts Len Rugen: 1 post

People

Translate

site design / logo © 2022 Grokbase