Decommission merulo
[mirror/dsa-puppet.git] / modules / debian-org / lib / facter / roleaccounts.rb
1 begin
2     require 'etc'
3
4     Facter.add("staticsync_key") do
5         setcode do
6             key = nil
7             keyfile = '/home/staticsync/.ssh/id_rsa.pub'
8             if FileTest.exist?(keyfile)
9                 key = File.open(keyfile).read.chomp
10             end
11             key
12         end
13     end
14
15     Facter.add("staticsync_user_exists") do
16         setcode do
17             result = ''
18             begin
19                 if Etc.getpwnam('staticsync')
20                     result = true
21                 end
22             rescue ArgumentError
23             end
24             result
25         end
26     end
27
28
29     Facter.add("weblogsync_key") do
30         setcode do
31             key = nil
32             keyfile = '/home/weblogsync/.ssh/id_rsa.pub'
33             if FileTest.exist?(keyfile)
34                 key = File.open(keyfile).read.chomp
35             end
36             key
37         end
38     end
39
40     Facter.add("weblogsync_user_exists") do
41         setcode do
42             result = ''
43             begin
44                 if Etc.getpwnam('weblogsync')
45                     result = true
46                 end
47             rescue ArgumentError
48             end
49             result
50         end
51     end
52
53
54     Facter.add("buildd_key") do
55         setcode do
56             key = nil
57             keyfile = '/home/buildd/.ssh/id_rsa.pub'
58             if FileTest.exist?(keyfile)
59                 key = File.open(keyfile).read.chomp
60             end
61             key
62         end
63     end
64
65     Facter.add("buildd_user_exists") do
66         setcode do
67             result = ''
68             begin
69                 if Etc.getpwnam('buildd')
70                     result = true
71                 end
72             rescue ArgumentError
73             end
74             result
75         end
76     end
77
78     Facter.add("portforwarder_key") do
79         setcode do
80             key = nil
81             keyfile = '/home/portforwarder/.ssh/id_rsa.pub'
82             if FileTest.exist?(keyfile)
83                 key = File.open(keyfile).read.chomp
84             end
85             key
86         end
87     end
88
89     Facter.add("portforwarder_user_exists") do
90         setcode do
91             result = ''
92             begin
93                 if Etc.getpwnam('portforwarder')
94                     result = true
95                 end
96             rescue ArgumentError
97             end
98             result
99         end
100     end
101
102
103
104 rescue Exception => e
105 end
106 # vim:set et:
107 # vim:set ts=4:
108 # vim:set shiftwidth=4: