Thank you Andrew and Johan.
Andrew's suggestion made the fact work with Facter when run alone (outside
of Puppet) such as "facter --debug" -- the value of my new hello fact
shows up in the output now
Johan's suggestion got it working when I run Puppet from the commandline.
If I do "puppet agent --test" then I see the the value printed out with the
notify line I put in sites.pp
That helped a lot!
On Thursday, January 9, 2014 8:25:09 AM UTC-8, Johan De Wit wrote:
>
> The facts should go into :
>
> /etc/puppetlabs/puppets/module/hello/lib/facter/
>
> if you do a puppet agent -t, it will deployed in the right place by puppet.
>
> you can also do a 'puppet plugin download'
>
> hope this helps
>
>
>
> On 01/08/2014 10:52 PM, Shark Laser wrote:
>
>
> Platform: I've downloaded and installed the learning VM. This system
> runs CentOS with Facter v1.7.3 and Puppet v3.3.1 (Puppet Enterprise
> 3.1.0).
>
> I've created a fact called hello.rb with the following content:
>
> Facter.add(:hello) do
> setcode do
> "Hello world!"
> end
> end
>
> I've placed the file in /etc/puppetlabs/facter/facts.d (I made this
> directory since the tutorial said to create it if it did not exist).
> I added a line to /etc/puppetlabs/puppet/manifests/site.pp for the default
> node: notify { $::hello: } . If I run puppet agent --test, it behaves
> as if my custom fact does not exist:
>
> Notice: undef
> Notice: /Stage[main]//Node[default]/Notify[undef]/message: defined
> 'message' as 'undef'
>
> So then the instructions said we could debug the fact by running facter
> --debug. If I do this, I see an error:
>
> Fact file /etc/puppetlabs/facter/facts.d/hello.rb was parsed but returned
> an empty data set
>
> I thought this meaningful but the same error will occur for any Facter
> custom fact I put in there. Even verbatim copy/paste jobs from known
> working examples off the tutorial. Does anyone know what is going
> on? I can't tell if the fact is in the wrong directory for Puppet when
> it uses Facter, but for some reason Facter sees it when run in
> standalone? If the latter is the case, why do I get these parse errors
> despite having valid source?
>
> Thanks for any help.
>
>
>
>
>
> --
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/90578665-1151-4df5-8a46-27e03ab877d6%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> Johan De Wit
>
> Open Source Consultant
>
> Red Hat Certified Engineer (805008667232363)
> Puppet Certified Professional 2013 (PCP0000006)
> _________________________________________________________
>
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72 Fax +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile +32 (0)474/42 40 73
> BELGIUM http://www.open-future.be
> _________________________________________________________
>
>
>
> Upcoming Events:
>
> Puppet Fundamentals Training |
> http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
>
> Puppet Introduction Course |
> http://www.open-future.be/puppet-introduction-course-7th-february
>
> Zabbix Certified Training |
> http://www.open-future.be/zabbix-certified-training-10-till-12th-february
>
> Zabbix for Large Environments Training |
> http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february
>
> Subscribe to our newsletter: http://eepurl.com/BUG8H
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/c17f69fb-db5b-4db0-9d43-d79c4827b4f9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.