Ruby custom fact question/problem

94 views
Skip to first unread message

llo...@oreillyauto.com

unread,
Jun 29, 2012, 4:05:53 PM6/29/12
to puppet...@googlegroups.com
I originally started this post to ask about one problem, but in the process of getting the question written I learned that it was due to differences between 1.8.7 and 1.9.2 that had caused my problem, so I got that fixed.

I now have the fact successfully loading when I run puppet:

info: Loading facts in /var/lib/puppet/lib/facter/node_id.rb

However, when I run facter, I can't find node_id.

facter | grep node
No LSB modules are available.


Is there another step I am missing? Also, one thing I didn't understand (and so may have done wrong) is how the actual fact gets set. Is it simply the last variable/string used in the code?

Thanks.

Nigel Kersten

unread,
Jun 29, 2012, 4:12:53 PM6/29/12
to puppet...@googlegroups.com
On Fri, Jun 29, 2012 at 1:05 PM, llo...@oreillyauto.com
<llo...@oreillyauto.com> wrote:
> I originally started this post to ask about one problem, but in the process
> of getting the question written I learned that it was due to differences
> between 1.8.7 and 1.9.2 that had caused my problem, so I got that fixed.
>
> I now have the fact successfully loading when I run puppet:
>
> info: Loading facts in /var/lib/puppet/lib/facter/node_id.rb
>
> However, when I run facter, I can't find node_id.
>
> facter | grep node
> No LSB modules are available.

You need to tell Facter to load the puppet facts like:

facter -p | grep node

or just

facter -p node_id



>
> Is there another step I am missing? Also, one thing I didn't understand (and
> so may have done wrong) is how the actual fact gets set. Is it simply the
> last variable/string used in the code?

Yep.


>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/nRd4lsLLKd0J.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.



--
Nigel Kersten | http://puppetlabs.com | @nigelkersten
Schedule Meetings at: http://tungle.me/nigelkersten

R.I.Pienaar

unread,
Jun 29, 2012, 4:13:18 PM6/29/12
to puppet...@googlegroups.com
You have to pass -p or --puppet to facter on the cli to make it
aware of facts copied out using puppet pluginsync

llo...@oreillyauto.com

unread,
Jun 29, 2012, 4:38:07 PM6/29/12
to puppet...@googlegroups.com

Comments inline

On Friday, June 29, 2012 3:13:18 PM UTC-5, R.I. Pienaar wrote:


In this case... also had to use sudo, but that may just be due to the permissions on /var/lib/puppet.

But I can see that it is working now, and is working as expected.

Thanks all.
Reply all
Reply to author
Forward
0 new messages