diff options
author | David Schmitt <david.schmitt@puppetlabs.com> | 2015-09-01 08:31:31 +0100 |
---|---|---|
committer | David Schmitt <david.schmitt@puppetlabs.com> | 2015-09-01 08:31:31 +0100 |
commit | 9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007 (patch) | |
tree | 552a7c02b4615a7e2f772e70628628330e7ccda4 /lib | |
parent | b10978703a5e4f07f240c509a3cf881210fbd5c5 (diff) | |
parent | 6c2a003f2139a482f92f245ce1d49830be13c5f1 (diff) |
Merge pull request #515 from jfautley/ticket/MODULES-2478-support_root_home_fact_on_AIX
(MODULES-2478) Make root_home fact work on AIX using native lsuser command
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/root_home.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb index b4f87ff..ee3ffa8 100644 --- a/lib/facter/root_home.rb +++ b/lib/facter/root_home.rb @@ -30,3 +30,16 @@ Facter.add(:root_home) do hash['dir'].strip end end + +Facter.add(:root_home) do + confine :kernel => :aix + root_home = nil + setcode do + str = Facter::Util::Resolution.exec("lsuser -C -a home root") + str && str.split("\n").each do |line| + next if line =~ /^#/ + root_home = line.split(/:/)[1] + end + root_home + end +end |