Jira (FACT-2666) Puppet lookup CLI loads external Facts on the initiating node

43 views
Skip to first unread message

Marty Ewings (Jira)

unread,
Jun 17, 2020, 5:26:03 AM6/17/20
to puppe...@googlegroups.com
Marty Ewings created an issue
 
Facter / Bug FACT-2666
Puppet lookup CLI loads external Facts on the initiating node
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/06/17 2:25 AM
Priority: Normal Normal
Reporter: Marty Ewings

Puppet lookup CLI loads external Facts on the initiating node, which causes problems as the execution time of these facts is an unknown and limitless variable, which is harmful in needlessly increasing the round trip time of a hiera lookup, which is unfavorable in an automation environment

 

Reproduction,

 

In an environment where external facts are plugin synced to the local machine, run a puppet lookup with the --debug flag turned on.

 puppet lookup --node doesntexist foo --debug

This will show the fact resolution on  the local machine

 
 

$ puppet lookup --node doesntexist foo --debug ... Debug: Facter: resolving facts from executable file "/opt/puppetlabs/facter/facts.d/slow.rb".
Debug: Facter: executing command: /opt/puppetlabs/facter/facts.d/slow.rb
Debug: Facter: slow=true
Debug: Facter: SLOW FACT
Debug: Facter: process exited with status code 0.
Debug: Facter: fact "slow" has resolved to "true".
Warning: Facter: external fact file "/opt/puppetlabs/facter/facts.d/slow.rb" had output on stderr: SLOW FACT

 
 

 

details:

 it seems the external fact resolution may have been explicitly added in https://github.com/puppetlabs/facter/blob/bebd6ce74cb735a6393691f0c445b328b59a0a44/lib/src/ruby/ruby.cc#L24 for https://tickets.puppetlabs.com/browse/FACT-1277

 

 

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Austin Boyd (Jira)

unread,
Jun 17, 2020, 5:27:03 AM6/17/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 39561

Austin Boyd (Jira)

unread,
Jun 17, 2020, 5:27:04 AM6/17/20
to puppe...@googlegroups.com

Marty Ewings (Jira)

unread,
Jun 19, 2020, 8:32:03 AM6/19/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 23, 2020, 11:03:05 AM6/23/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 23, 2020, 11:03:06 AM6/23/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 24, 2020, 5:17:02 AM6/24/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-06-08

Mihai Buzgau (Jira)

unread,
Jun 24, 2020, 5:17:03 AM6/24/20
to puppe...@googlegroups.com

Dorin Pleava (Jira)

unread,
Jun 29, 2020, 8:04:03 AM6/29/20
to puppe...@googlegroups.com

Jarret Lavallee (Jira)

unread,
Jul 2, 2020, 4:42:03 PM7/2/20
to puppe...@googlegroups.com
Jarret Lavallee commented on Bug FACT-2666
 
Re: Puppet lookup CLI loads external Facts on the initiating node

Marty Ewings Is the desired outcome from this ticket to not pull the local facts from facter when the --node flag is passed into puppet lookup?

Marty Ewings (Jira)

unread,
Jul 2, 2020, 5:01:03 PM7/2/20
to puppe...@googlegroups.com
Marty Ewings commented on Bug FACT-2666

I would say more than that. lookup shouldn't use live gathered facts, there is no reason to. puppet lookup shouldnt ideally load any facts locally, but specifically external and custom, they will have the most potential impact on the round trip time for the lookup

Mihai Buzgau (Jira)

unread,
Jul 8, 2020, 3:40:03 AM7/8/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-07-08 , NW - 2020-07-21

Henrik Lindberg (Jira)

unread,
Jul 8, 2020, 6:10:05 AM7/8/20
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug FACT-2666
 
Re: Puppet lookup CLI loads external Facts on the initiating node

There is the masterless use case to consider as well - then there is no master to obtain facts from using --node and if not running facter to get the node's facts, then the user would have to produce them to a file and give that on the command line.

Jarret Lavallee (Jira)

unread,
Jul 9, 2020, 7:10:03 PM7/9/20
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
 
Change By: Jarret Lavallee
CS Priority: Needs Priority Reviewed

Josh Cooper (Jira)

unread,
Jul 15, 2020, 3:23:04 AM7/15/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2666
 
Re: Puppet lookup CLI loads external Facts on the initiating node

Loading of external facts is an issue for all puppet commands, not just lookup, due to the certname being derived from hostname and domain facts, combined with external facts being able to override core facts.

Marty Ewings (Jira)

unread,
Jul 15, 2020, 3:36:03 AM7/15/20
to puppe...@googlegroups.com
Marty Ewings updated an issue
 
Change By: Marty Ewings
Method Found: Needs Assessment Customer Feedback

Mihai Buzgau (Jira)

unread,
Jul 23, 2020, 3:28:04 AM7/23/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-07-08, NW - 2020-07-21 , NW - 2020-08-06

Dorin Pleava (Jira)

unread,
Aug 4, 2020, 1:11:03 PM8/4/20
to puppe...@googlegroups.com
Dorin Pleava updated an issue
Change By: Dorin Pleava
Release Notes: Bug Fix
Release Notes Summary: Some puppet default settings required facter to retrieve the data which
caused facter to load all external facts that are not used. This can
slow down puppet if external facts are slow.

Now, only when performing a lookup command on a remote node, local external facts are not evaluated.

Mihai Buzgau (Jira)

unread,
Aug 5, 2020, 6:57:03 AM8/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-07-08, NW - 2020-07-21, NW - 2020-08-06 , NW - 2020-08-18

Dorin Pleava (Jira)

unread,
Aug 19, 2020, 8:42:03 AM8/19/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 13, 2020, 6:31:03 PM11/13/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2666
 
Re: Puppet lookup CLI loads external Facts on the initiating node

I see facter 4 has a load_external_facts method, but there isn't a top-level load_external, so I think this will be a regression in puppet 7 with facter 4 as the default:

$ bx irb
irb(main):001:0> require 'facter'
=> true
irb(main):002:0> Facter.respond_to? :load_external
=> false
irb(main):003:0> Facter.load_external
E, [2020-11-13T15:28:52.931038 #25475] ERROR -- : Facter - --load_external-- not implemented but required
with params: []
with block: nil

Matthias Fetzer (Jira)

unread,
Mar 8, 2022, 8:48:01 AM3/8/22
to puppe...@googlegroups.com

dorin.pleava josh - we are currently migrating from puppet 6 to puppet 7 and we (heavily) rely on running "puppet lookup --node" on the puppet master in order to retrieve hiera values for the agents. In hiera we use a bunch for custom facts to determine settings accordingly.

This does not seem to work anymore with puppet 7 - is there a workaround on how to determine a hiera-value for a node using custom facts? Or is there a way to enable the resolving of external facts, when running "puppet lookup"?

If not, should I open a feature request for this?

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 8, 2022, 12:04:03 PM3/8/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2666

fetzerms you should be able to pass all facts used to resolve hiera data by passing the facts in a file using --facts <file>.json

Reply all
Reply to author
Forward
0 new messages