summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJon Fautley <jon@dead.li>2015-08-27 14:53:02 +0100
committerJon Fautley <jon@dead.li>2015-08-28 15:21:13 +0100
commit6c2a003f2139a482f92f245ce1d49830be13c5f1 (patch)
tree552a7c02b4615a7e2f772e70628628330e7ccda4 /lib
parentb10978703a5e4f07f240c509a3cf881210fbd5c5 (diff)
downloadpuppet-stdlib-6c2a003f2139a482f92f245ce1d49830be13c5f1.tar.gz
puppet-stdlib-6c2a003f2139a482f92f245ce1d49830be13c5f1.tar.bz2
(MODULES-2478) Support root_home fact on AIX through "lsuser" command
Squashed, and amended test for comment lines.
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/root_home.rb13
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