retire old DNS root key
[mirror/dsa-puppet.git] / modules / debian_org / lib / facter / software.rb
1 Facter.add("apache2") do
2         setcode do
3                 if FileTest.exist?("/usr/sbin/apache2")
4                         true
5                 else
6                         false
7                 end
8         end
9 end
10 Facter.add("clamd") do
11         setcode do
12                 if FileTest.exist?("/usr/sbin/clamd")
13                         true
14                 else
15                         false
16                 end
17         end
18 end
19 Facter.add("exim4") do
20         setcode do
21                 if FileTest.exist?("/usr/sbin/exim4")
22                         true
23                 else
24                         false
25                 end
26         end
27 end
28 Facter.add("postfix") do
29         setcode do
30                 if FileTest.exist?("/usr/sbin/postfix")
31                         true
32                 else
33                         false
34                 end
35         end
36 end
37 Facter.add("postgres") do
38         setcode do
39                 pg = (FileTest.exist?("/usr/lib/postgresql/9.1/bin/postgres") or
40                 FileTest.exist?("/usr/lib/postgresql/9.4/bin/postgres") or
41                 FileTest.exist?("/usr/lib/postgresql/9.6/bin/postgres"))
42                 if pg
43                         true
44                 else
45                         false
46                 end
47         end
48 end
49 Facter.add("postgrey") do
50         setcode do
51                 if FileTest.exist?("/usr/sbin/postgrey")
52                         true
53                 else
54                         false
55                 end
56         end
57 end
58 Facter.add("greylistd") do
59         setcode do
60                 FileTest.exist?("/usr/sbin/greylistd")
61         end
62 end
63 Facter.add("policydweight") do
64         setcode do
65                 if FileTest.exist?("/usr/sbin/policyd-weight")
66                         true
67                 else
68                         false
69                 end
70         end
71 end
72 Facter.add("spamd") do
73         setcode do
74                 if FileTest.exist?("/usr/sbin/spamd")
75                         true
76                 else
77                         false
78                 end
79         end
80 end
81 Facter.add("php5") do
82         php =   (FileTest.exist?("/usr/lib/apache2/modules/libphp5.so") or
83                 FileTest.exist?("/usr/bin/php5") or
84                 FileTest.exist?("/usr/bin/php5-cgi") or
85                 FileTest.exist?("/usr/lib/cgi-bin/php5"))
86         setcode do
87                 if php
88                         true
89                 else
90                         false
91                 end
92         end
93 end
94 Facter.add("php5suhosin") do
95         suhosin=(FileTest.exist?("/usr/lib/php5/20060613/suhosin.so") or
96                 FileTest.exist?("/usr/lib/php5/20060613+lfs/suhosin.so"))
97         setcode do
98                 if suhosin
99                         true
100                 else
101                         false
102                 end
103         end
104 end
105 Facter.add("syslogversion") do
106         setcode do
107                 %x{dpkg-query -W -f='${Version}\n' syslog-ng | cut -b1-3}.chomp
108         end
109 end
110 Facter.add("unbound") do
111         unbound=(FileTest.exist?("/usr/sbin/unbound") and
112                 FileTest.exist?("/var/lib/unbound/root.key"))
113         setcode do
114                 if unbound
115                         true
116                 else
117                         false
118                 end
119         end
120 end
121 Facter.add("munin_async") do
122         setcode do
123                 FileTest.exist?("/usr/share/munin/munin-async")
124         end
125 end
126 Facter.add("samhain") do
127         setcode do
128                 if FileTest.exist?("/usr/sbin/samhain")
129                         true
130                 else
131                         false
132                 end
133         end
134 end
135 Facter.add("systemd") do
136         setcode do
137                 init = '/sbin/init'
138                 if File.symlink?(init) and File.readlink(init) == "/lib/systemd/systemd"
139                         true
140                 else
141                         false
142                 end
143         end
144 end
145 Facter.add("tor_ge_0_2_9") do
146         setcode do
147                 system(%{test -n "$(dpkg-query -W -f='${Version}' tor 2>/dev/null)" && dpkg --compare-versions "$(dpkg-query -W -f='${Version}' tor)" ge 0.2.9})
148         end
149 end
150 Facter.add("haveged") do
151         setcode do
152                 FileTest.exist?("/usr/sbin/haveged")
153         end
154 end
155 Facter.add("bgpd") do
156         setcode do
157                 FileTest.exist?("/usr/sbin/bgpd")
158         end
159 end
160 Facter.add("zebra") do
161         setcode do
162                 FileTest.exist?("/usr/sbin/zebra")
163         end
164 end
165 Facter.add("update_grub") do
166         setcode do
167                 FileTest.exist?("/usr/sbin/update-grub")
168         end
169 end
170 Facter.add("haproxy") do
171         setcode do
172                 FileTest.exist?("/usr/sbin/haproxy")
173         end
174 end