]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/stdlib/lib/facter/root_home.rb
upgrade to concat 2.0.0
[dsa-puppet.git] / modules / stdlib / lib / facter / root_home.rb
1 # A facter fact to determine the root home directory.
2 # This varies on PE supported platforms and may be
3 # reconfigured by the end user.
4
5 module Facter::Util::RootHome
6   class << self
7   def get_root_home
8     root_ent = Facter::Util::Resolution.exec("getent passwd root")
9     # The home directory is the sixth element in the passwd entry
10     root_ent.split(":")[5]
11   end
12   end
13 end
14
15 Facter.add(:root_home) do
16   setcode { Facter::Util::RootHome.get_root_home }
17 end