Environment facts
Environment facts allow you to override core facts and add custom facts.
To access a fact set with environment variables, you can use the CLI or the Ruby API
(Facter.value
or Facter.fact
methods). Use the
environment variable prefixed with FACTER_
, for example:
$ facter virtual physical $ FACTER_virtual=virtualbox facter virtual virtualbox
Note that environment facts are downcased before they are added to the fact collection,
for example, FACTER_EXAMPLE
and FACTER_example
resolve
to a single fact named example
.