Feature #15596

External fact location should be configurable via an environment variable

Added by Andrew Parker 11 months ago. Updated 10 months ago.

Status:In Topic Branch Pending ReviewStart date:07/18/2012
Priority:NormalDue date:
Assignee:Evan Pierce% Done:

0%

Category:-
Target version:2.0.0
Keywords: Affected Facter version:
Branch:https://github.com/puppetlabs/facter/pull/306

Description

Right now the external facts are hard coded to two directories (on unix) and one directory (on windows). The user has no control over these unless they pass a command line argument to facter. However, the command line argument can only specify a single directory. This makes it a less than ideal user experience when trying to use facter as a systems tool.

Instead of these hard coded paths and a single way of overriding, we should change it so that facter uses an environment variable as a path of directories to look for external facts.

export FACTER_PATH=/usr/share/facts:/usr/local/facts
facter   # will look in /usr/share/facts first and then in /usr/local/facts.

Any facts that are found earlier in the path are more important than facts found later in the path.

Open questions:

  • What should be done if FACTER_PATH is not set?
  • If we have FACTER_PATH, then do we need any command line options for controlling the path?
  • If there are command line options, how do they interact with a set FACTER_PATH
  • Can a user effectively remove all external facts if they set FACTER_PATH=''?

Related issues

Related to Facter - Feature #2157: External fact support Closed 05/18/2012 05/18/2012

History

#1 Updated by Andrew Parker 11 months ago

  • Description updated (diff)

#2 Updated by Randall Hansen 11 months ago

Andrew Parker wrote:

What should be done if FACTER_PATH is not set?

Use the existing defaults.

If we have FACTER_PATH, then do we need any command line options for controlling the path?

No. One way to do it is best.

Can a user effectively remove all external facts if they set FACTER_PATH=''?

Yes.

#3 Updated by Hailee Kenney 11 months ago

  • Status changed from Unreviewed to Accepted

#4 Updated by Evan Pierce 10 months ago

Hey, Jeff suggested I take a look at this as a way to get started with tickets. Feel free to take over if you need to.

#5 Updated by Evan Pierce 10 months ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Assignee set to Evan Pierce
  • Branch set to https://github.com/puppetlabs/facter/pull/306

Also available in: Atom PDF