X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Ffacter%2Froot_home.rb;h=87c76571885be2d23b5b43620032c0e6e703d8f2;hb=6963202b4b62c2816655ac9532521b018fdf83bd;hp=b4f87ff2ab2c7a49a421d2e5281d8d9f86211f97;hpb=a69999e580f8b3abd12446c2d6ad59e517651813;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/facter/root_home.rb b/3rdparty/modules/stdlib/lib/facter/root_home.rb index b4f87ff2a..87c765718 100644 --- a/3rdparty/modules/stdlib/lib/facter/root_home.rb +++ b/3rdparty/modules/stdlib/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