--- /dev/null
+provides "postgresql"
+
+postgresql Mash.new
+
+Dir.glob("/etc/postgresql/*/*/postgresql.conf").each do |conf|
+ cluster = conf.sub("/etc/postgresql/", "").sub("/postgresql.conf", "")
+
+ postgresql[:clusters] = Mash.new unless postgresql[:clusters]
+ postgresql[:clusters][cluster] = Mash.new unless postgresql[:clusters][cluster]
+ postgresql[:clusters][cluster][:version] = cluster.split("/").first.to_f
+
+ IO.foreach(conf) do |line|
+ if line =~ /^ *port *= *([0-9]+)\s+/
+ postgresql[:clusters][cluster][:port] = $1
+ end
+ end
+end