Peter Foley
2012-Apr-29 07:42 UTC
[Puppet Users] Is there a way to see find out if a module is installed for use?
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.
Len Rugen
2012-Apr-29 20:00 UTC
Re: [Puppet Users] Is there a way to see find out if a module is installed for use?
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 <peter@ifoley.id.au> 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
2012-Apr-30 11:57 UTC
[Puppet Users] Re: Is there a way to see find out if a module is installed for use?
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 <lenru...@gmail.com> 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.