package "postgresql-common"
-service "postgresql" do
- action [ :enable, :start ]
- supports :status => true, :restart => true, :reload => true
-end
-
node[:postgresql][:versions].each do |version|
package "postgresql-#{version}"
package "postgresql-client-#{version}"
end
end
+service "postgresql" do
+ action [:enable, :start]
+ supports :status => true, :restart => true, :reload => true
+end
+
ohai_plugin "postgresql" do
template "ohai.rb.erb"
end
clusters = node[:postgresql][:clusters] || []
-clusters.each do |name,details|
+clusters.each do |name, details|
suffix = name.tr("/", ":")
munin_plugin "postgres_bgwriter_#{suffix}" do
conf_variables :port => details[:port]
end
- if File.exist?("/var/lib/postgresql/#{details[:version]}/main/recovery.conf")
- munin_plugin "postgres_replication_#{suffix}" do
- target "postgres_replication"
- conf "munin.erb"
- conf_variables :port => details[:port]
- end
+ next unless File.exist?("/var/lib/postgresql/#{details[:version]}/main/recovery.conf")
+
+ munin_plugin "postgres_replication_#{suffix}" do
+ target "postgres_replication"
+ conf "munin.erb"
+ conf_variables :port => details[:port]
end
end