]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/debian-org/lib/facter/software.rb
Simplify postgres fact
[dsa-puppet.git] / modules / debian-org / lib / facter / software.rb
index 533c77933cdfa9ef0a5ae6dda26c86c3578907f7..4404d6fba0e5142f021a7e85ec679b1230071756 100644 (file)
@@ -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
                        ''