Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1874

Environment variable-supplied facts should be resolved prior to confines

    XMLWordPrintable

Details

    • Improvement
    • Status: Needs Information
    • Normal
    • Resolution: Unresolved
    • FACT 3.11.3
    • None
    • None
    • Platform OS
    • Needs Assessment

    Description

      When testing another issue I discovered that facts supplied as environment variables are evaluated after confines, and therefore can't be used to override/supply a value for a confine based on a fact.

      Given a fact in envfact/myfact.rb:

      Facter.add(:myfact) do
        confine matchfact: 'matches'
        setcode do
          "fact results"
        end
      end
      

      where "matchfact" otherwise does not exist, I would expect this to work:

      $ FACTER_matchfact=matches facter --custom-dir=envfact -d myfact

      but instead it returns nothing.

      A look at the debug logs clearly shows the environment variable-based facts not resolving until after the custom fact.

      Thank you.

      Attachments

        Activity

          People

            branan Branan Riley
            seanmil Sean Millichamp
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support