> On Oct 21, 2015, at 12:56 PM, Hugo Deprez <hugo.dep...@gmail.com> wrote:
> 
> Hello,
> 
> I created a custom fact with the following procedure :
> 
> mkdir -p /etc/puppet/modules/facts/lib/facter
> touch apache.rb
> 
> Content of apache.rb file :
> Facter.add('apache') do
>   setcode do
>      apache_package = Facter::Core::Execution.exec('which apache2')
>          
>     # if 'which apache2' exits with an error, jruby_path will be an empty 
> string
>     if apache_package == ""
>       false
>     else
>       true
>     end
>   end
> end
> 
> this is working when I use the $apache in templates, but when I do :
> #facter apache 
> 
> I got an empty answer.
> 
> How can I add the value to facter ?
> 
> Best regards,
> 
> Hugo


To load puppet-provided facts, you need to add the '-p' option. 'facter -p 
apache' should work.

--
Peter

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6A5B1F20-D1EC-4E30-B74A-5C1A22095A6C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to