Hello All,
I have a facter question, is the use of ruby environmental variables
encouraged or discouraged? I noticed that path.rb uses the ruby ENV object,
but id.rb does not use it. However, if id.rb did use it then it could be
reduced to 5 lines like so:
Facter.add(:id) do
setcode do
ENV['USER']
end
end
Is there any particular reason that 'whoami' (Linux) and 'id' (Solaris) are
used instead?
Here is some custom facts i made for windows. What do you think?
1 # Windows specific facts
2
3 Facter.add(:homeshare) do
4 confine :kernel => %w{Windows}
5 setcode do
6 ENV['HOMESHARE']
7 end
8 end
9
10 # Doesn't notice if its a roaming profile
11 Facter.add(:userprofile) do
12 confine :kernel => %w{Windows}
13 setcode do
14 ENV['USERPROFILE']
15 end
16 end
17
18 Facter.add(:appdata) do
19 confine :kernel => %w{Windows}
20 setcode do
21 ENV['APPDATA']
22 end
23 end
24
25 Facter.add(:deploydate) do
26 confine :kernel => %w{Windows}
27 setcode do
28 ENV['DEPLOY_DATE']
29 end
30 end
--
William Van Hevelingen
Portland State University
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.