end
end
end
-Facter.add("clamd") do
- setcode do
- if FileTest.exist?("/usr/sbin/clamd")
- true
- else
- ''
- end
- end
-end
-Facter.add("exim4") do
+Facter.add("apache2deb9") do
setcode do
- if FileTest.exist?("/usr/sbin/exim4")
+ # jessie (deb8) has 2.4.10-.., stretch (deb9) will have 2.4.23 or later.
+ if FileTest.exist?("/usr/sbin/apache2") and system("dpkg --compare-versions $(dpkg-query -W -f='${Version}\n' apache2-bin) gt 2.4.15")
true
else
''
end
end
end
-Facter.add("postfix") do
- setcode do
- if FileTest.exist?("/usr/sbin/postfix")
- true
- else
- ''
- end
- end
-end
-Facter.add("postgres81") do
+Facter.add("clamd") do
setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.1/bin/postgres")
+ if FileTest.exist?("/usr/sbin/clamd")
true
else
''
end
end
end
-Facter.add("postgres83") do
+Facter.add("exim4") do
setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.3/bin/postgres")
+ if FileTest.exist?("/usr/sbin/exim4")
true
else
''
end
end
end
-Facter.add("postgres84") do
+Facter.add("postfix") do
setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.4/bin/postgres")
+ if FileTest.exist?("/usr/sbin/postfix")
true
else
''
end
end
end
-Facter.add("postgres90") do
+Facter.add("postgres") do
setcode do
- if FileTest.exist?("/usr/lib/postgresql/9.0/bin/postgres")
+ pg = (FileTest.exist?("/usr/lib/postgresql/8.1/bin/postgres") or
+ FileTest.exist?("/usr/lib/postgresql/8.3/bin/postgres") or
+ FileTest.exist?("/usr/lib/postgresql/8.4/bin/postgres") or
+ FileTest.exist?("/usr/lib/postgresql/9.0/bin/postgres") or
+ FileTest.exist?("/usr/lib/postgresql/9.1/bin/postgres") or
+ FileTest.exist?("/usr/lib/postgresql/9.2/bin/postgres"))
+ if pg
true
else
''
end
end
Facter.add("php5") do
- php = FileTest.exist?("/usr/lib/apache2/modules/libphp5.so") or
+ php = (FileTest.exist?("/usr/lib/apache2/modules/libphp5.so") or
FileTest.exist?("/usr/bin/php5") or
FileTest.exist?("/usr/bin/php5-cgi") or
- FileTest.exist?("/usr/lib/cgi-bin/php5")
+ FileTest.exist?("/usr/lib/cgi-bin/php5"))
setcode do
if php
true
end
end
Facter.add("php5suhosin") do
- suhosin=FileTest.exist?("/usr/lib/php5/20060613/suhosin.so") or
- FileTest.exist?("/usr/lib/php5/20060613+lfs/suhosin.so")
+ suhosin=(FileTest.exist?("/usr/lib/php5/20060613/suhosin.so") or
+ FileTest.exist?("/usr/lib/php5/20060613+lfs/suhosin.so"))
setcode do
if suhosin
true
end
end
Facter.add("unbound") do
- unbound=FileTest.exist?("/usr/sbin/unbound") and
- FileTest.exist?("/var/lib/unbound/root.key")
+ unbound=(FileTest.exist?("/usr/sbin/unbound") and
+ FileTest.exist?("/var/lib/unbound/root.key"))
setcode do
if unbound
true
end
end
end
+Facter.add("munin_async") do
+ setcode do
+ FileTest.exist?("/usr/share/munin/munin-async")
+ end
+end
+Facter.add("samhain") do
+ setcode do
+ if FileTest.exist?("/usr/sbin/samhain")
+ true
+ else
+ ''
+ end
+ end
+end
+Facter.add("systemd") do
+ setcode do
+ init = '/sbin/init'
+ if File.symlink?(init) and File.readlink(init) == "/lib/systemd/systemd"
+ true
+ else
+ ''
+ end
+ end
+end
+Facter.add("tor_ge_0_2_9") do
+ setcode do
+ system(%{dpkg -l tor >/dev/null 2>&1 && dpkg --compare-versions $(dpkg-query -W -f='${Version}' tor) ge 0.2.9})
+ end
+end