end
end
end
-Facter.add("postgres81") do
- setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.1/bin/postgres")
- true
- else
- ''
- end
- end
-end
-Facter.add("postgres83") do
- setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.3/bin/postgres")
- true
- else
- ''
- end
- end
-end
-Facter.add("postgres84") do
- setcode do
- if FileTest.exist?("/usr/lib/postgresql/8.4/bin/postgres")
- true
- else
- ''
- end
- end
-end
-Facter.add("postgres90") do
- setcode do
- if FileTest.exist?("/usr/lib/postgresql/9.0/bin/postgres")
+Facter.add("postgres") do
+ setcode do
+ 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
end
-Facter.add("munin-async") do
+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