Skip to content

Commit 98373f1

Browse files
committed
(MODULES-2478) Support root_home fact on AIX through "lsuser" command
1 parent b109787 commit 98373f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/facter/root_home.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@ def get_root_home
3030
hash['dir'].strip
3131
end
3232
end
33+
34+
Facter.add(:root_home) do
35+
confine :kernel => :aix
36+
root_home = nil
37+
setcode do
38+
str = Facter::Util::Resolution.exec("lsuser -C -a home root")
39+
str && str.split("\n").each do |line|
40+
next if line =~ /#/
41+
root_home = line.split(/:/)[1]
42+
end
43+
root_home
44+
end
45+
end

0 commit comments

Comments
 (0)