summaryrefslogtreecommitdiffstats
path: root/lib/facter/domain.rb
diff options
context:
space:
mode:
authorBen H <git@mumble.org.uk>2011-03-13 14:07:37 +1100
committerBen Hughes <ben@puppetlabs.com>2011-03-31 17:35:40 +1100
commit7c082702c72c168f3e739b9bc1c7562b0aa15ddd (patch)
tree48a5a3fc8c76ef67981def4fd6e9d574a824a379 /lib/facter/domain.rb
parent28f475ab83319e1bf15ee108d5895cadc72383ad (diff)
downloadfacter-7c082702c72c168f3e739b9bc1c7562b0aa15ddd.tar.gz
facter-7c082702c72c168f3e739b9bc1c7562b0aa15ddd.tar.xz
facter-7c082702c72c168f3e739b9bc1c7562b0aa15ddd.zip
(#5394) Document each Facter fact.
Document all the builtin Facter facts in puppetdoc/rdoc format. This is laying the ground work for using a tool like puppet doc, or puppet describe but for facter, so you can see what a fact is for and how it resolves this. This is the "leg work" of documenting the actual facts, and the syntax of them may change in future.
Diffstat (limited to 'lib/facter/domain.rb')
-rw-r--r--lib/facter/domain.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/facter/domain.rb b/lib/facter/domain.rb
index 29bb204..2a79754 100644
--- a/lib/facter/domain.rb
+++ b/lib/facter/domain.rb
@@ -1,3 +1,23 @@
+# Fact: domain
+#
+# Purpose:
+# Return the host's primary DNS domain name.
+#
+# Resolution:
+# On UNIX (excluding Darwin), first try and use the hostname fact,
+# which uses the hostname system command, and then parse the output
+# of that.
+# Failing that it tries the dnsdomainname system command.
+# Failing that it uses /etc/resolv.conf and takes the domain from that, or as
+# a final resort, the search from that.
+# Otherwise returns nil.
+#
+# On Windows uses the win32ole gem and winmgmts to get the DNSDomain value
+# from the Win32 networking stack.
+#
+# Caveats:
+#
+
Facter.add(:domain) do
setcode do
# Get the domain from various sources; the order of these