I have a custom package provider. However within the ruby code, I need access a custom facter fact (which has the path to the executable which handles the package installation). I tried doing lookupvar(''bin_path'' ) but it complained "undefined method `lookupvar''" So how do I reference a facter fact from within a custom provider? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Stefan Schulte
2013-Mar-22 18:43 UTC
Re: [Puppet Users] facter fact within a custom provider
On Fri, 22 Mar 2013 10:29:22 -0700 (PDT) Jist Anidiot <jistanidiot@gmail.com> wrote:> I have a custom package provider. However within the ruby code, I > need access a custom facter fact (which has the path to the > executable which handles the package installation). > > I tried doing lookupvar(''bin_path'' ) but it complained "undefined > method `lookupvar''" > > So how do I reference a facter fact from within a custom provider? > > Thanks in advance. >to get the value of a fact (no matter if it is a custom fact or a buildin fact) use `my_path = Facter.value(:bin_path)` -Stefan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.