X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fdebian-org%2Flib%2Ffacter%2Fsoftware.rb;h=ba4c1be38933a0216111956aedc72c861e4e517c;hb=b699362de1187bf21e28967cc45b6ab2c3bc5c66;hp=de30d49a1bce570e8590eb01cd7502968988234f;hpb=500dd5ecaab513bf474d817785da991c6ee53fff;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian-org/lib/facter/software.rb b/modules/debian-org/lib/facter/software.rb index de30d49a1..ba4c1be38 100644 --- a/modules/debian-org/lib/facter/software.rb +++ b/modules/debian-org/lib/facter/software.rb @@ -34,36 +34,15 @@ Facter.add("postfix") do 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 '' @@ -142,8 +121,27 @@ Facter.add("unbound") do 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