]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Simplify postgres fact
authorStephen Gran <steve@lobefin.net>
Sun, 16 Sep 2012 15:20:19 +0000 (16:20 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 16 Sep 2012 15:20:19 +0000 (16:20 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
manifests/site.pp
modules/debian-org/lib/facter/software.rb

index e56ca7d112f44be264fb56a366d9d7a78c82bed9..46becc707a9ba88b902302c7450f810760fa149c 100644 (file)
@@ -110,7 +110,7 @@ node default {
                include debian-org::radvd
        }
 
-       if ($::postgres84 or $::postgres90) {
+       if ($::postgres) {
                include postgres
        }
 
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
                        ''