Custom fact query

24 views
Skip to first unread message

daveford...@gmail.com

unread,
May 8, 2024, 5:12:31 AMMay 8
to Puppet Users

Total ruby noob and first time trying to right a custom fact. It does look too complication and I've sort of got this working.. But one question - from the puppet documentation gives two ways of using a 'confine'.

This lets me custom fact produce output via facter on my gentoo box as expected
confine :kernel => "Linux"

But this produces no output -
confine :kernel do |value|

value == "Linux"

end
What am I failing to understand- the documentation would suggest both should work?

Am trying this on a Mint box running facter 4.4.0 and ruby 3.0.2


Thanks in advance. 
Dave

daveford...@gmail.com

unread,
May 8, 2024, 5:15:11 AMMay 8
to Puppet Users

To clarify, tried this on various systems - facter 4.4.0 and ruby 3.0.2 on Ubuntu Mint and facter 4.7.0 and ruby 3.1.4 on gentoo.  Examples taken from the puppet documentation on writing custom facts. 

Ben Ford

unread,
May 8, 2024, 6:49:26 PMMay 8
to puppet...@googlegroups.com
Hi Dave!

This bug was actually just fixed in https://github.com/puppetlabs/facter/pull/2705

For now, you'll need to compare to the downcased version of the string and I'll file a ticket to get that noted in docs.

Good luck!



On May 8, 2024, at 2:15 AM, daveford...@gmail.com <daveford...@gmail.com> wrote:

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1da07872-5d29-42e8-9aa6-62c3feb4087fn%40googlegroups.com.


CAUTION: This email originated from outside of the organization. Do not click on links or open attachments unless you recognize the sender and know the content is safe.



This e-mail may contain information that is privileged or confidential. If you are not the intended recipient, please delete the e-mail and any attachments and notify us immediately.


Reply all
Reply to author
Forward
0 new messages