summaryrefslogtreecommitdiffstats
path: root/lib/facter/id.rb
blob: cc0a0a6b657c8dd0d985e5a64481f79825506c55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Fact: id
#
# Purpose: Internal fact used to specity the program to return the currently
# running user id.
#
# Resolution:
#   On all Unixes bar Solaris, just returns "whoami".
#   On Solaris, parses the output of the "id" command to grab the username, as
#   Solaris doesn't have the whoami command.
#
# Caveats:
#

Facter.add(:id) do
    setcode "whoami"
end

Facter.add(:id) do
    confine :kernel => :SunOS
    setcode "/usr/xpg4/bin/id -un"
end