summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--documentation/custom.page21
-rw-r--r--documentation/index.page11
2 files changed, 29 insertions, 3 deletions
diff --git a/documentation/custom.page b/documentation/custom.page
new file mode 100644
index 0000000..49afd56
--- /dev/null
+++ b/documentation/custom.page
@@ -0,0 +1,21 @@
+---
+inMenu: true
+---
+
+Facter does everything it can to make adding custom facts easy. It will
+autoload any files it finds in a ``facter/`` directory in its search
+path, so you don't need to modify the package files. Also, Facter will
+search through your environment for any variables whose names start with
+'FACTER_' (case insensitive) and automatically add those facts.
+
+As a simple example, here is how I publish my home directory to Puppet:
+
+ Facter.add("home") do
+ setcode do
+ ENV['HOME']
+ end
+ end
+
+I have ~/lib/ruby in my $RUBYLIB environment variable, so I just created
+~/lib/ruby/facter and dropped the above code into a ``home.rb`` file
+within that directory.
diff --git a/documentation/index.page b/documentation/index.page
index ac6a829..443c465 100644
--- a/documentation/index.page
+++ b/documentation/index.page
@@ -1,11 +1,16 @@
---
-inMenu: true
+inMenu: false
directoryName: Facter
---
-A cross-platform Ruby library for retrieving facts from operating systems. Supports multiple resolution mechanisms, any of which can be restricted to working only on certain operating systems or environments. Facter is especially useful for retrieving things like operating system names, IP addresses, MAC addresses, and SSH keys.
+A cross-platform Ruby library for retrieving facts from operating systems.
+Supports multiple resolution mechanisms, any of which can be restricted to
+working only on certain operating systems or environments. Facter is especially
+useful for retrieving things like operating system names, IP addresses, MAC
+addresses, and SSH keys.
-It is easy to extend Facter to include your own custom facts or to include additional mechanisms for retrieving facts.
+It is easy to extend Facter to include your own [custom facts](custom.html) or
+to include additional mechanisms for retrieving facts.
* [Downloads](/downloads/facter)
* [Bug Tracking](/cgi-bin/facter.cgi)