X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3a4b1c2078cd515e93a5f1bf8967f380fbd1646f..79e281814b6b7e100cc1bf6e1cfacb47ccc28155:/cookbooks/postgresql/recipes/default.rb diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index a8b37c590..a0d9f0e90 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -19,11 +19,6 @@ 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}" @@ -89,6 +84,11 @@ node[:postgresql][:versions].each do |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 @@ -131,11 +131,11 @@ clusters.each do |name, details| 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