The Creating custom facts recipe describes how to add extra facts written in Ruby. You can also create facts from simple files or from scripts with external facts instead. External facts may be written in YAML, JSON, or txt format.
External facts live in the /etc/facter/facts.d directory and have a simple key=value format:
message="Hello, world"