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.